#!/usr/bin/perl -wl print __PACKAGE__; package My::Package; print __PACKAGE__; __END__ Prints: main My::Package
Update: As per the comment below, if you want the filename and not the package name then you should use __FILE__, also in perldata.
--
John.
In reply to Re: Searching for an alternative to $0
by jmcnamara
in thread Searching for an alternative to $0
by dimar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |