in reply to do 45-47 to array 45,46,47
Or with eval:
use strict; use warnings; my $_ = "45-48, 88-99, 102-124"; my @result = map { s/-/../; eval $_ } /(\d+-\d+)/g; print "@result\n";
In Section
Seekers of Perl Wisdom
in reply to do 45-47 to array 45,46,47
Or with eval:
use strict; use warnings; my $_ = "45-48, 88-99, 102-124"; my @result = map { s/-/../; eval $_ } /(\d+-\d+)/g; print "@result\n";