$0, or the URI to it in
$ENV{'SCRIPT_NAME'}. $0 might bork if you're running mod_perl, I don't recall. There's also
__FILE__, a magic constant which is the full path to the file in which it is literally written.
print "This print is in file " . __FILE__ . "\n";