in reply to Searching for an alternative to $0
#!/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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Searching for an alternative to $0
by Abigail-II (Bishop) on May 19, 2004 at 08:46 UTC |