in reply to How do I find what directory the perl script is running from?

This works quite well:
$0=~/^(.+[\\\/])[^\\\/]+[\\\/]*$/; $cgidir= $1 || "./";