Loading ...
Sorry, an error occurred while loading the content.

[PBML] Fwd: something to do with require . .

Expand Messages
  • pang khong lin
    ... SORRY THIS PART SHOULD BE test2.pl and not test.pl ... ______________________________________________________
    Message 1 of 2 , Sep 1, 1998
    • 0 Attachment
      >this is part of the contents for test.pl
      >
      >$REQUIRE_DIR="c:\\taform\\cgi-bin\\";
      >push(@INC,$REQUIRE_DIR) if $REQUIRE_DIR;
      >require 'test2.pl';
      >&sub1();
      >and so on . . .
      >
      SORRY THIS PART SHOULD BE test2.pl and not test.pl
      >
      >
      >sub sub1 {
      > print "firstvar=$firstvar";
      > print "secondvar=$secondvar";
      > my($firstvar)=1;
      > local($secondvar)=2;
      > print "firstvar=$firstvar";
      > print "secondvar=$secondvar";
      >}
      >
      >basically what i want to try out is the scope of variables using 'my'
      >and 'local' and whether they behave the same when the subroutine is in
      >the same program and when the subroutines are in separate files( which
      >will then require us to use -> require 'filename'; )
      >
      >The problem is when the program reaches line 3 of test.pl the following
      >mess. appears :-
      >
      >test2.pl did not return a true value at test.pl line3. <IN> chunk 3
      >
      >and the program stops.
      >
      >i have make sure that path is correct and i had even omit the value of
      >$REQUIRE_DIR since both of the file is in the same dir.
      >
      >thanks in advance.
      >


      ______________________________________________________

      ____________________________________________________________________

      List Site: http://www.findmail.com/list/perl-beginner/
      To unsubscribe, send to perl-beginner-unsubscribe@...

      FREE group e-mail lists at http://www.findmail.com
    • Dave Dustin
      ... As the last line of the test2.pl put: 1; This will return a true value, therefore the compiler will be happy when it loads in the module -- Dave Dustin
      Message 2 of 2 , Sep 1, 1998
      • 0 Attachment
        >>The problem is when the program reaches line 3 of test.pl the following
        >>mess. appears :-
        >>
        >>test2.pl did not return a true value at test.pl line3. <IN> chunk 3
        >>
        >>and the program stops.


        As the last line of the test2.pl put:

        1;

        This will return a true value, therefore the compiler will be happy when it
        loads in the "module"



        --
        Dave Dustin

        "Forgive and Remember"

        ____________________________________________________________________

        List Site: http://www.findmail.com/list/perl-beginner/
        To unsubscribe, send to perl-beginner-unsubscribe@...

        FREE group e-mail lists at http://www.findmail.com
      Your message has been successfully submitted and would be delivered to recipients shortly.