http://www.perlmonks.org?node_id=1053547


in reply to Escape Quote-Like Operators

What's your actual use case? You can save a bunch of characters by not branching (in your nonsensical example):
$_ = '12'; s/\d/n/g;s/n+/m/;
Update: Or, if you pay 3 more (still saving 2 from your 'ideal') you can get identical algorithmic behavior:
$_ = '12'; s/\d\d+/m/||s/\d/n/;
LTS FTW

Thanks to Anonymous Monk, realized my brain misread the comparator. However, the real use case is still relevant. As penance, optimization of the nonsensical example:

$_ = '12'; s/\d+/$&>10?'m':n/e;

#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.