Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: List-to-Range generation

by chipmunk (Parson)
on Jun 12, 2001 at 02:55 UTC ( #87672=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub num2range {
      local $_ = join ',' => @_;
      s/(?<!\d)(\d+)(?:,((??{$++1}))(?!\d))+/$1-$+/g;
      return $_;
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2016-09-01 05:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found