On May 28, 2004, at 10:27 AM, <Alexander.Farber@nokia.com> wrote: > Hi Ken and others, > > shouldn't the backslash in the last character class: > > $path =~ > m{^ ( (?: [a-zA-Z]: | > (?:\\\\|//)[^\\/]+[\\/][^\\/]+ > )? > ) > ( (?:.*[\\\\/](?:\.\.?\Z(?!\n))?)? ) > (.*) > }xs; > > be better listed just once? > > $path =~ > m{^ ( (?: [a-zA-Z]: | > (?:\\\\|//)[^\\/]+[\\/][^\\/]+ > )? > ) > ( (?:.*[\\/](?:\.\.?\Z(?!\n))?)? ) > (.*) > }xs; Sure, looks good. > > Also, may I ask you a File::Spec related real-life question? > > In the attached script I'm trying to convert a list > of Windows paths to a list of Unix paths (I'm trying to > convert some weird build system to plain Unix Makefiles). > Please just run it and you'll see how it works. > > Unfortunately this input line is wrongly parsed: > > ..\inc\cmmphonebookstoremesshandler.h \tcf > > The destination path \tcf is being parsed by > splitpath() as a dir ("\") and a file ("tcf"). In this case, you might be happier using Path::Class than File::Spec. It has a class for files and a class for directories, so you can unambiguously specify at creation time what it is. -KenThread Previous