This works fine:
# 'main script' require 'foo.pl'; foo(); # this is the content of foo.pl sub foo{ print"foo" } 1;
Perl will look for 'foo.pl' in @INC which will usually contain these three directories:
/Perl/lib /Perl/site/lib .
The . dir is the current dir. For more details on @INC see Simple Module Tutorial by tachyon Error messages are always useful when thing don't work. see also New Monks and the link on asking questions
doc
print(s<>ecode?scalar reverse :p)
In reply to Re: using other files with program
by doc
in thread using other files with program
by Zerhash
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |