Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: numeric manipulation

by FunkyMonk (Chancellor)
on Mar 11, 2011 at 19:02 UTC ( [id://892725]=note: print w/replies, xml ) Need Help??


in reply to numeric manipulation

The previous replies were all too pretty...

perl -wE '$_ = "7-12"; say join " ", [/(\d+)-/]->[0]..[/-(\d+)/]->[0]'

:-)

Update: slightly less ugly?

perl -wE '$_ = "7-12"; say join " ", (/(\d+)-/)[0]..(/-(\d+)/)[0]'

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-04-25 07:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found