From: Dan Baker [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 26, 2008 17:00 To: beginners@perl.org Subject: matching ' in regx
I have a thing driving me NUTS.... trying to detect a ' in a variable with regex, and either strip it out or at least detect and error out. for instance, this just does NOT work. $UploadedImage = 'badname\'s.jpg' ; if ( $UploadedImage =~ m/'/ ) { &Warning_Status( $cCgiStatusFile , "Cannot upload file with \' in the filename , ". "you MUST rename the file before upload!". "\nPlease use the browser \"Back\" button, and ". "try again after changing filename.\n" ); exit ; } How do I match the ' ? thanks, d Unsure what is happening. I copied the statements, replaced &warning with print and it came back with the statement that incorrect name. Removed the \', ran again, and nothing printed out. Now I just did as a simple script, but what you are executing here and what you are doing in your environment, there has to be a difference. Wags ;) David R Wagner Senior Programmer Analyst FedEx Freight 1.408.323.4225x2224 TEL 1.408.323.4449 FAX http://fedex.com/us ********************************************************************** This message contains information that is confidential and proprietary to FedEx Freight or its affiliates. It is intended only for the recipient named and for the express purpose(s) described therein. Any other use is prohibited. ********************************************************************** -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/