Greetings perl-win32-users,

This is not a strictly win32 question but relates to files in a win32
system so ...

The context is pretty obscure so I am including the very minimum code
snippet. @files is an array of all the files in the path folder. I
need to check whether the file $newname exists in the path folder. An
odd situation came up with a file named  "blah blah blah (1940.mid"
The author of the file forgot the closing ) which is fine for a
windows file name but grep sees the "(" as missing the ")" in a regex.
I have tried quoting and preceding  the ( or ) with \ to escape it but
none of this works. Any ideas? I could also just check the folder for
the presence of the file name but I have never found documentation on
how to do this. Since this would be more of a win32 question, maybe
that is what I should be asking. How do I check for the existence of a
file in a folder?

my @files = <$path/*>;
my $file_exists = 1 if (grep/$newname/,@files);



--
Best regards,
Spencer_Lists Chase        mailto:[EMAIL PROTECTED]
67550 Bell Springs Rd.
Garberville, CA 95542  Postal service only.
Laytonville, CA 95454  UPS only.
[EMAIL PROTECTED]
http://www.spencerserolls.com
http://www.spencerserolls.com/MidiValve.htm
(707) 984-8356

_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to