Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re^2: Capturing regex from map

by LanX (Saint)
on Sep 13, 2013 at 17:14 UTC ( [id://1053971]=note: print w/replies, xml ) Need Help??

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)


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.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1053971]
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-04-25 13:24 GMT
Find Nodes?
    Voting Booth?

    No recent polls found