in reply to How do I get the directory containing a given file?
use Cwd qw(abs_path); use File::Basename; my $dir = dirname(abs_path($file));
Turning this into a complete perl program is left as an exercise to the reader.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Answer: How do I get the directory containing a given file?
by mobiGeek (Beadle) on Feb 24, 2002 at 19:19 UTC | |
by wog (Curate) on Feb 24, 2002 at 20:02 UTC |
In Section
Seekers of Perl Wisdom