in reply to Hex-matching Regex pattern in scalar
It's not entirely clear to me what you are trying to achieve here, especially with no sample data. However, since it looks to me like you might be trying to transliterate characters perhaps tr is the way to go? Ignoring all the file ops:
#!/usr/bin/env perl use strict; use warnings; use Test::More; my $instr = "a\xe9b\xe9"; my $outstr = $instr =~ tr/\xe9/e/r; is ($outstr, 'aebe'); done_testing;
Does this fit your requirements and if not please specify in detail how not?
|
|---|