use 5.6.0; # XXX BUGGY # will be fixed shortly sub num2range { local $_ = join ',' => @_; s{(\d+?|)(\d+)(?:,\1((??{$++1})))+}{$1$2-$+}g; return $_; } [download]
In reply to List-to-Range (Advanced) by japhy