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.
In reply to Re^5: XP and slashes?
by ikegami
in thread XP and slashes?
by hsmyers
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |