in reply to How to get the shell script name

You could pass it in as an argument.

$0 is the program name, so call the perl script with that argument.

e.g.
# shell script: perl myscript.pl $0 ---- #perl script: print "Called by: ", $ARGV[0], "\n";