Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

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

by ColonelPanic (Friar)
on Nov 23, 2012 at 15:54 UTC ( #1005288=note: print w/ replies, xml ) Need Help??


in reply to Re^4: 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

Ha ha. I spent an inordinate amount of time trying to make a one-liner solution for arbitrarily large numbers (where it would go to "aa" after "z"). However, it turned out that today is Friday and I can't think that hard.



When's the last time you used duct tape on a duct? --Larry Wall


Comment on Re^5: Efficient way to replace a set of values with another set of values
Re^6: Efficient way to replace a set of values with another set of values
by tobyink (Abbot) on Nov 23, 2012 at 16:00 UTC

    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'

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1005288]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (12)
As of 2014-12-26 15:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (171 votes), past polls