Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
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 rifling through the Monastery: (8)
As of 2014-08-23 18:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (178 votes), past polls