Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re^2: Capturing regex from map

by LanX (Sage)
on Sep 13, 2013 at 17:14 UTC ( #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? | Other CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2022-12-07 19:51 GMT
Find Nodes?
    Voting Booth?

    No recent polls found