One could use map as in
my @digits = map { $_ =~ m{ \d }xmsg } $list;
but it would be, IMHO, simpler, clearer and more idiomatic as
>perl -wMstrict -le "my $list = '1, 23-456 7890'; my @digits = $list =~ m{ \d }xmsg; printf qq{'$_' } for @digits; " '1' '2' '3' '4' '5' '6' '7' '8' '9' '0'
(Although, to echo JavaFan, it's not really clear just what you want.)
In reply to Re: using map
by AnomalousMonk
in thread using map
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |