in reply to Re^2: String Comparison & Equivalence Challenge
in thread String Comparison & Equivalence Challenge
$ro->insert(end => join "", map s/^(\d\d)\d*/$1%/r . "\n", @matches[...] );$ro->insert(end => join "", map { do { (my $s = $_ ) =~ s/^(\d\d)\d*/$1%/ . "\n"; $s }, @matches[...] });
Try:
$ro->insert(end => join "", map { (my $r = $_) =~ s/^(\d\d)\d*/$1%/; "$r\n"; } @matches[0 .. $bestcount - 1]);
Update:
... the s///r pragma.NB: s///r is not a pragma. /r is a modifier (update: available from Perl version 5.14 on) of the s/// operator.
Give a man a fish: <%-{-{-{-<
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: String Comparison & Equivalence Challenge
by Polyglot (Chaplain) on Mar 15, 2021 at 04:54 UTC | |
by AnomalousMonk (Archbishop) on Mar 15, 2021 at 06:25 UTC |