Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: List-to-Range generation

by abjr (Initiate)
on Aug 23, 2011 at 20:07 UTC ( #921991=note: print w/replies, xml ) Need Help??

in reply to List-to-Range generation

10 years later this is still really cool. I've been using if for a while now and there is one small issue I've seen. If you have a list of numbers, say 1,2,3 ... 39999,40000 and run it through num2range, you'll get the following back: "1-32768,32769-40000" instead of "1-40000".

I'm guessing this is because you can't have more than 32k captures in a regex?

Replies are listed 'Best First'.
Re^2: List-to-Range generation
by OfficeLinebacker (Chaplain) on Apr 25, 2013 at 01:13 UTC
    Hmm, just trying to figure out a way to test this is bending my mind. So is this true? This method only works for ranges up to 2^15?

    What if you split up the ranges? It would work for any list of up to 32,768 consecutive numbers, right?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://921991]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (4)
As of 2017-11-24 06:35 GMT
Find Nodes?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:

    Results (345 votes). Check out past polls.