ganeshk has asked for the wisdom of the Perl Monks concerning the following question:
package Mod; use File::Spec::Functions qw(splitpath); print( (splitpath(__FILE__))[1], "\n");
This worked in some cases, but when I ran this command
from the same directory as Mod.pm, it didn't work.
perl -e 'use Mod;'
So I thought this approach was wrong. Could anyone
please tell me how to do it? And what was wrong
with my way?
Thanks very much in advance.
Edit g0n: replaced b tags with code tags
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to find path for current module?
by davidrw (Prior) on Jul 22, 2005 at 12:40 UTC | |
|
Re: How to find path for current module?
by japhy (Canon) on Jul 22, 2005 at 12:52 UTC | |
|
Re: How to find path for current module?
by blazar (Canon) on Jul 22, 2005 at 12:38 UTC | |
|
Re: How to find path for current module?
by ganeshk (Monk) on Jul 22, 2005 at 12:54 UTC | |
by davidrw (Prior) on Jul 22, 2005 at 13:06 UTC | |
by ganeshk (Monk) on Jul 22, 2005 at 13:33 UTC | |
by tlm (Prior) on Jul 22, 2005 at 13:00 UTC | |
|
Re: How to find path for current module?
by tlm (Prior) on Jul 22, 2005 at 12:41 UTC |