in reply to Re:Capturing occurrence counts via tr/// with variable interpolation
in thread Capturing occurrence counts via tr/// with variable interpolation
Works fine if split into two statements or modified slightly:Can't modify bitwise xor (^) in transliteration (tr///) at /tmp/t line + 9, near "tr[\0][\0];"
Note that it works IFF length($SrchStr)==1my $ans = ($_=( $str ^ ( $SrchStr x length $str ) )) =~ tr[\0][\0];
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Capturing occurrence counts via tr/// with variable interpolation
by BrowserUk (Patriarch) on Aug 15, 2005 at 13:56 UTC |