Beefy Boxes and Bandwidth Generously Provided by pair Networks RobOMonk
more useful options
 
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 having an uproarious good time at the Monastery: (12)
As of 2014-04-21 16:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (498 votes), past polls