in reply to Re^4: In place search and replace with a hash
in thread In place search and replace with a hash
13:25 >perl -wE "my %h = (x => 0, '$1' => 1); my $s = 'axb'; say $s =~ + s/(x)/$h{$1}/r; say $s =~ s/(x)/$h{'$1'}/r;" a0b a1b 13:27 >
?
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: In place search and replace with a hash
by LanX (Saint) on Dec 28, 2014 at 03:42 UTC | |
by Athanasius (Archbishop) on Dec 28, 2014 at 08:26 UTC | |
by LanX (Saint) on Dec 28, 2014 at 13:27 UTC | |
by Anonymous Monk on Dec 28, 2014 at 08:51 UTC |