in reply to Re^4: XP and slashes?
in thread XP and slashes?
use Cwd qw( realpath ); use File::Basename qw( dirname ); use File::Spec::Functions qw( catdir ); my $mod = __PACKAGE__; $mod =~ s{::}{/}g; $mod .= '.pm'; $mod = $INC{$mod}; my $module_dir_qfn = dirname(realpath($mod)); my $db_dir_qfn = catdir($module_dir_qfn, 'db');
But there's no need to waste four lines getting the file name when it's already provided for you.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: XP and slashes?
by hsmyers (Canon) on Apr 05, 2009 at 09:11 UTC | |
|
Re^6: XP and slashes?
by hsmyers (Canon) on Apr 05, 2009 at 09:50 UTC | |
by ikegami (Patriarch) on Apr 05, 2009 at 22:21 UTC |