in reply to Re: Self Testing Modules
in thread Self Testing Modules

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

Replies are listed 'Best First'.
Re^3: Self Testing Modules
by demerphq (Chancellor) on Dec 18, 2005 at 09:59 UTC

    Doh. Doh. Doh.

    happy-the-monk is correct, i got it backwards. :-(

    ---
    $world=~s/war/peace/g