in reply to Re: Help with Regular Expressions
in thread Help with Regular Expressions

nemesdani,

Actually, I am using that module, and unless I am missing something, when it's a directory the $_ will either contain the full path, or the directory name of the current directory.

using my example above I would get a list like:

  • DirD
  • DirE
  • Enabling no_chdir => 1 will produce

  • \\DirA\DirB\DirC\DirD
  • \\DirA\DirB\DirC\DirD\DirE
  • Which I can then use the File::Spec->abs2rel and get \DirD\DirE

    The reason I am after \DirD\DirE is I want to then append this to another base path to see if a file / directory exist in that location

    Replies are listed 'Best First'.
    Re^3: Help with Regular Expressions
    by nemesdani (Friar) on Apr 10, 2012 at 20:44 UTC
      Oh, I slightly misunderstood your question, forgive me. In this case, I don't know any better solution than Riales', and I still think an OS-independent regex would be too much trouble for this particular problem.


      I'm too lazy to be proud of being impatient.