dislimit has asked for the wisdom of the Perl Monks concerning the following question:
Someone told me that I can use 'require' as '#include' to do that. So I write the following test program.
Actually I saw the '.' in the perllib path displayed in the error msg of 'use'. So I think the './' is not necessary. But either of the above 'require' line will give a fatal error (depending on which line appears ealier.system "pwd"; # a.pl in the current directory contains the implementation of &tpack. require "a.pl"; require "./a.pl"; &tpack;
Could anybody tell me what's wrong and how shall I make it?a.pl did not return a true value at ./require.plx line 7.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: #include equivalent in Perl.
by ysth (Canon) on Dec 26, 2006 at 05:26 UTC | |
|
Re: #include equivalent in Perl.
by davido (Cardinal) on Dec 26, 2006 at 05:16 UTC | |
|
Re: #include equivalent in Perl.
by jdporter (Paladin) on Dec 26, 2006 at 05:16 UTC | |
|
Re: #include equivalent in Perl.
by ides (Deacon) on Dec 26, 2006 at 15:05 UTC | |
|
Re: #include equivalent in Perl.
by swampyankee (Parson) on Dec 26, 2006 at 15:41 UTC | |
|
Re: #include equivalent in Perl.
by rir (Vicar) on Dec 27, 2006 at 19:53 UTC |