Nice! But note that you can get the effect of the eval by adding a second /e modifier instead:
22:18 >perl -wE "my $s = '1 2 3*2 4 5x3'; $s =~ s/(\d+)[xX*](\d+)\s*/q +q['$1 ' x $2]/gee; say qq[\n|$s|];" |1 2 3 3 4 5 5 5 | 22:19 >
Hope that’s of interest,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
In reply to Re^2: Search and replace with expansion
by Athanasius
in thread Search and replace with expansion
by davehorsfall
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |