http://qs321.pair.com?node_id=1053971


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)

Replies are listed 'Best First'.
Re^3: Capturing regex from map
by thezip (Vicar) on Sep 13, 2013 at 19:37 UTC

    That's what I get for not testing! </sheepish grin>


    What can be asserted without proof can be dismissed without proof. - Christopher Hitchens, 1949-2011
    A reply falls below the community's threshold of quality. You may see it by logging in.