http://www.perlmonks.org?node_id=147195


in reply to Re: How do I get the directory containing a given file?
in thread How do I get the directory containing a given file?

use Cwd qw(abs_path); use File::Basename; my $dir = dirname(abs_path("../foo.html"));<BR> print "dir is ($dir)\n";

yields:

  opendir(../foo.html/..): Not a directory at text.pl line 4
  dir is ()

Other ideas?