in reply to How was my script launched?
Additionally, you might get some further clues from inspecting the filename ($0) or the command line arguments (@ARGV). If your OS supports symbolic links, than aliasing your script by symlinking it might be another alternative to identify launch circumstances. E.g., if you symlink yourscript.pl to alt_name.pl and then call the latter, $0 =~ m{/alt_name\.pl$} will render true, at least under *NIX.