in reply to hash with multiple values per key

First thing that comes to mind...
%hash = ( a => '15-19,30,35,120', b => '15-17,30-35,40', c => '15-18,30,35,120', ); for (keys %hash ) { ($s = $hash{ $_}) =~ s/-/../g; $hash{$_} = join(',',eval $s); }; print "$_ => $hash{$_}\n" for sort keys %hash; __END__ a => 15,16,17,18,19,30,35,120 b => 15,16,17,30,31,32,33,34,35,40 c => 15,16,17,18,30,35,120

--shmem

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}