develooper Front page | perl.perl5.porters | Postings from April 2006

[perl #24704] Regex replace looses chars

Thread Next
From:
Steve Peters via RT
Date:
April 17, 2006 10:41
Subject:
[perl #24704] Regex replace looses chars
Message ID:
rt-3.0.11-24704-132326.7.07598411657415@perl.org
> [perl-5.8.0@ton.iguana.be - Fri Dec 19 13:16:25 2003]:
> 
> 
> This is a bug report for perl from perl-5.8.0@ton.iguana.be,
> generated with the help of perlbug 1.34 running under perl v5.8.0.
> 
> 
> -----------------------------------------------------------------
> [Please enter your report here]
> 
> perl -le '$_="65x"; print; s/65/chr/e; print; print unpack("H*", $_)'
> 65x
> Ax
> 4178
> 
> This is normal.
> 
> perl -le '$_="x65x"; s/x//; print; s/65/chr/e; print; print
>    unpack("H*", $_)'
> 65x
> A
> 4100
> 
> Where did the second x go ????
> 

It looks like somewhere in Dave's modifications, this bug has been fixed.

> perl -le '$_="x65x"; s/x//; print; s/65/chr/e; print; print
unpack("H*", $_)'
65x
A
4100
> ./perl -le '$_="x65x"; s/x//; print; s/65/chr/e; print; print
unpack("H*", $_)'
65x
Ax
4178


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About