in reply to arrays and loop through array
Replacing
$str =~ s/-/\.\./g; [download]
$str =~ s/(\d+)-(\d+)/join(",",$1..$2)/ge; [download]