in reply to #include equivalent in Perl.
Clearly, a.pl needs to return a true value. Any true value will do; conventionally the number 1 is used. Just add
somewhere near the bottom of a.pl. (You'll have to determine the exact appropriate place.)return 1;
Often you'll see the return keyword omitted. Whether or not this is appropriate to do depends, again, on the specific structure of the file.
If you had read the documentation of require, you'd have seen these words:
The file must return true as the last statement to indicate successful execution of any initialization code, so it's customary to end such a file with 1; unless you're sure it'll return true otherwise. But it's better just to put the 1;, in case you add more statements.
See also this tutorial.
|
|---|