A use statement (as in use module;) evals the contents of a file. The last expression in the file must evaluate to true, or the eval dies.
Not quite. eval never dies based on the value returned by the evaluated expression.
>perl -e"eval { 0 }" >
require (and thus use) dies if the values returned by the module is false.
>copy nul Module.pm 1 file(s) copied. >perl -e"use Module;" Module.pm did not return a true value at -e line 1. BEGIN failed--compilation aborted at -e line 1. >echo 1; > Module.pm >perl -e"use Module;" >
In reply to Re^2: End of subroutine
by ikegami
in thread End of subroutine
by sandy_1028
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |