if (caller) { ... }
All right except demerphq got it the wrong way round.
What he meant was:
unless ( caller ) { # here go the tests that are only called when the module is run as +: # perl Module.pm }
It's part of my cargo cult programming style. You know the documentation of caller, as you've already written in this thread.
Cheers, Sören
Update: I just saw a similar thing on a thread at German language Perl-Community.de.
eserte writes:
return 1 if caller; # end of the module's own code # Test Code goes here
In reply to Re^2: Self Testing Modules
by Happy-the-monk
in thread Self Testing Modules
by Sheol
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |