in reply to Using "USE" instead of "DO" for subroutines call in external file
Files which are loaded by use or require must return a true value. That is usually done by making the statement, 1; the last perl statement in the file. If you exit the file early with return, a true value represents success, false an error condition.
The major difference between use and do is that use happens at compile time as if it were in a BEGIN block, but do, like require, happens at runtime. There are also differences in the scope of variables and the matter of the return value you found. See perlfunc for details.
After Compline,
Zaxo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Using "USE" instead of "DO" for subroutines call in external file
by Anonymous Monk on May 27, 2005 at 07:09 UTC | |
by Zaxo (Archbishop) on May 27, 2005 at 07:23 UTC | |
by Anonymous Monk on May 27, 2005 at 07:31 UTC | |
by Zaxo (Archbishop) on May 27, 2005 at 07:53 UTC |