On Tue, 2008-08-26 at 17:59 -0600, Dan Baker wrote:
> 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
> 

You match it exactly like you're doing.  Since CGI is involved, I'd look
elsewhere from the problem.  Are you absolutely certain that some
software between the browser and your program is not translating
badname's.jpg into badname's.jpg ?


-- 
Just my 0.00000002 million dollars worth,
  Shawn

"Where there's duct tape, there's hope."
        Cross Time Cafe

"Perl is the duct tape of the Internet."
        Hassan Schroeder, Sun's first webmaster


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to