I have a Perl script (standalone program) which contains some subs I'd like to reuse in other scripts. Due to limitations of the execution environment, I can't move the functions to a common .pm file.
Is it possible to differentiate whether the script was run as a standalone program or it was requireed/doed by another script?
The only thing I could find was to use caller at the top level: standalone program doesn't have any caller while when requireed caller shows who did load the module. Is there any better solution?
 
     
    