Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

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]
[Michael W]: So i can read ok from this how do i put data back inmy @Variables = ( $Map_Request_Date, $Map_Due_Date,$Map _Cutover_Date,$Map _Complete_Date,$Ma p_Approved_Date);
[Corion]: Michael_W: $Variables[0] = $Map_Request_Date; $Variables[1] = $Map_Due_Date; ...
[choroba]: ( $Map_Request_Date, $Map_Due_Date,$Map _Cutover_Date,$Map _Complete_Date,$Ma p_Approved_Date) = @Variables;?
[thezip]: something like: $Map_Request = <value>; etc. should work
[Corion]: Duh - I read it backwards. I shouldn't code today I guess ;)
[thezip]: G'day all, BTW!

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (11)
As of 2017-04-27 15:33 GMT
Find Nodes?
    Voting Booth?
    I'm a fool:

    Results (509 votes). Check out past polls.