Peter Beardsley <[EMAIL PROTECTED]> writes:

> I'm dealing with import data from a Mac that has non-ascii apostrophes
> that are hex d5.  I wrote a regular expression in perl to replace them:
> 
> 
>          my $hex = 0xd5;
>          $str =~ s/$hex/\'/g;
> 
> OK, now if I make a string in perl with this character in it like so:
> 
>          my $str = 'foo' . 0xd5 . 's string';
> 
> The above regular expression matches.  If I run it on a string
> containing the character from my input file, it doesn't match.

What happens when you use this instead?:

   my $hex = chr(0xd5);
   $str =~ s/$hex/\'/g;

--kevin
-- 
Kevin D. Clark (cetaceannetworks.com!kclark)  |   Will hack Perl for
Cetacean Networks, Inc.                       |  fine food, good beer,
Portsmouth, N.H. (USA)                        |       or fun.
alumni.unh.edu!kdc (PGP Key Available)        |


*****************************************************************
To unsubscribe from this list, send mail to [EMAIL PROTECTED]
with the text 'unsubscribe gnhlug' in the message body.
*****************************************************************

Reply via email to