in reply to Re: finding the absolute path to a module, from the module's, perspective
in thread finding the absolute path to a module, from the module's, perspective
Quote: BTW - an absolute path has no "perspective", its an absolute path.
What I meant by that statement is that I don't want the absolute path of the script that's calling the module, I want the absolute path of the module the script is calling - that's the difference in perspective.
Quote: Try it again, because that works. If it doesn't work for you, upgrade File::Spec.
Well, here's proof of what you're saying, I give you FOO.pm:
And here's a test cgi script:package FOO; use File::Spec; require Exporter; @ISA = qw(Exporter); @EXPORT = qw(bar); sub bar { print File::Spec->rel2abs(__FILE__) . "\n"; } 1;
#!/usr/bin/perl use FOO; use CGI qw(:standard); print header(); FOO::bar();
Prints: /home/user/www/cgi-bin/test.pl
But (of course, sigh), my not as tiny program is still giving me the not-so-absolute path. It's almost as if it thinks the absolute path *starts* at the lib directory.
Hmm. I'll come post back if I can figure something else out, must be some weird gremlin hunting about.
-justin simoni
!skazat!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: finding the absolute path to a module, from the module's, perspective
by PodMaster (Abbot) on Sep 12, 2004 at 04:51 UTC | |
by skazat (Chaplain) on Sep 12, 2004 at 05:00 UTC | |
by ysth (Canon) on Sep 12, 2004 at 06:55 UTC |