in reply to Re^2: Platform Independent Directory Traversal
in thread Platform Independent Directory Traversal

Your example code looks like what I usually use. I prefer File::Spec::Functions sometimes, but it seems workable to me.

  • Comment on Re^3: Platform Independent Directory Traversal

Replies are listed 'Best First'.
Re^4: Platform Independent Directory Traversal
by wind (Priest) on Jul 29, 2007 at 07:11 UTC
    Ahhh, now that makes something presentable.
    use File::Basename qw(dirname); use File::Spec::Functions qw(rel2abs catdir updir); print rel2abs(catdir( dirname(__FILE__), updir() ));
    Yeah, I was attempting to follow the suggested standard of not infecting the package namespace by using the OO version. However, the functional version of File::Spec really does make it easier to follow (IMO).

    - Miller