in reply to Is there a more functional regex syntax?
I'm not exactly sure the expected output is for the cases where there is only one digit. I took a guess that the min = max in these cases, so if there is no second number, I use the first again.
s|^(\d+)(\-(\d+))?$|$total_min += $1; $total_max += $3//$1|e for (@r +anges);
|
|---|