On Thu, Jun 30, 2005 at 07:14:49AM -0000, schwern @ windhund. schwern. org wrote: > use File::Basename; > > print dirname "/var/local/"; > > I would expect "/var/local/". Instead you get "/var". Normally on Unix > you can't tell the difference between /foo/dir and /foo/file but the trailing > slash disambiguates. File::Spec gets this right. > > use File::Spec; > > ($vol, $dirs, $file) = File::Spec->splitpath("/var/local/"); > print $dirs;
On the other hand, the Linx dirname on my FC3 system behaves like the current perl one: $ dirname /var/local /var $ dirname /var/local/ /var I think it could be argued either way, but personally I prefer the current behaviour; and keeping it that way avoids a run-in with the BC police :-) -- "The greatest achievement of the Austrians has been convincing the world that Hitler was German, and Mozart Austrian."