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


in reply to Re^5: Efficient way to replace a set of values with another set of values
in thread Efficient way to replace a set of values with another set of values

You were looking for:

s/^(\d+)/$n=$1;$l="a";$l++while--$n;$l/meg

Doesn't cope with 0 especially well.

perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'
  • Comment on Re^6: Efficient way to replace a set of values with another set of values
  • Download Code