How's about:
use List::Util qw[ sum ]; my @ranges = ('15', '28-31', '3-4', '40', '17-19'); my $tMin = sum map{ /^(\d+)/ } @ranges; my $tMax = sum map{ /(\d+)$/ } @ranges; print "$tMin : $tMax";; 103 : 109
In reply to Re: Is there a more functional regex syntax?
by BrowserUk
in thread Is there a more functional regex syntax?
by smls
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |