in reply to Dual personality: Module and script
So, unless (defined caller) { ... } will execute that code if it's being brought in as the main level of the program, rather than a module.caller EXPR caller Returns the context of the current subroutine call. In sca +lar context, returns the caller's package name if there is a c +aller, that is, if we're in a subroutine or "eval" or "require", +and the undefined value otherwise. [....]
-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.
|
|---|