Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: find the continuity in the data file

by repellent (Priest)
on Feb 05, 2012 at 02:50 UTC ( [id://951894]=note: print w/replies, xml ) Need Help??


in reply to find the continuity in the data file

useSet::IntSpan::Fast;
my @n = qw(16 107 108 110 112 114 115 117 118 119 120 121 122 123 124 +125 127 128 130 132 133 135 136 138 142 146 149 150 154 156 157 158 1 +59 161 162); my $set = Set::IntSpan::Fast->new; $set->add(@n); print $set->as_string, "\n"; __END__ 16,107-108,110,112,114-115,117-125,127-128,130,132-133,135-136,138,142 +,146,149-150,154,156-159,161-162

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (6)
As of 2024-03-28 08:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found