http://www.perlmonks.org?node_id=994307


in reply to Is there a more functional regex syntax?

What about something more like:
$range =~ /^(\d+)(?:-(\d+))?$/; $total_min += $1; $total_min += $2//$1;
I personally think holding onto $min and $max reads easier, but I can understand the desire for conciseness.

#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.