in reply to Re: Capturing regex from map
in thread Capturing regex from map
> try my @online_services = map { /^online.*svc:(.*?):/; $1 } `svcs`;
not equivalent:
DB<217> map { /(1\d*)/;$1 } 5..15 => (undef, undef, undef, undef, undef, 10, 11, 12, 13, 14, 15) DB<218> map { /(1\d*)/ } 5..15 => (10, 11, 12, 13, 14, 15)
Cheers Rolf
( addicted to the Perl Programming Language)
update
I think you meant:
DB<225> map { @matches=/(1\d*)/;@matches} 5..15 => (10, 11, 12, 13, 14, 15)
In Section
Seekers of Perl Wisdom