Pardon my stupidity, but in the above example, since the print "$ARGV[0]\n"; # the name of the real file ? is in the script 'sli.pl' wouldn't replacing it with $0 actually return 'sli.pl'?
You are correct; I was under the impression that was what the OP wanted. Now I'm not sure :)
The shebang mechanism does put the interpreted script in argv[1] (to use the common c name), so yes, if what's mean by "real file" is the file in the target language, $ARGV[0] should be used in the interpreter.