in reply to Find the full path of the script at run time

How is the script called? In some brief testing I found that using the file association in Windows caused $0 to contain the full path to the script (something like scriptname.pl from the script's directory). Calling the script via perl \full\path\to\script.pl (executing from either the directory containing the script, or another directory) worked as well. Calling the script from within the script's directory using perl scriptname.pl failed -- only the script name was in $0.

Not sure how $0 is affected in non-Windows OSs, though...