jaa has asked for the wisdom of the Perl Monks concerning the following question:
Dear Monks
Is there a special var or some other way that tells me the filename of the current module?
I want to do something like:
my $package = __PACKAGE_FILENAME__; my $related = $package; $related =~ s/this.pm/other.pm/; if ( -e $related ) { require $related; else { die "related package missing: $related"; }
Thanks!
Jeff
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Filename of current package
by amw1 (Friar) on Mar 22, 2004 at 18:39 UTC | |
by jaa (Friar) on Mar 22, 2004 at 19:27 UTC | |
|
Re: Filename of current package
by ambrus (Abbot) on Mar 22, 2004 at 20:08 UTC | |
by jaa (Friar) on Mar 23, 2004 at 09:10 UTC | |
|
Re: Filename of current package
by jaa (Friar) on Mar 22, 2004 at 19:38 UTC |