Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^5: Named Captures

by JavaFan (Canon)
on Oct 06, 2010 at 15:02 UTC ( #863805=note: print w/ replies, xml ) Need Help??


in reply to Re^4: Named Captures
in thread Named Captures

Not quite.

() = 'abc' =~ /(?<a>a)|(?<f>f)/ and do {say for keys %-}; __END__ a f
%- will have a key for every named capture in the pattern, whether that capture was involved in the match or not.


Comment on Re^5: Named Captures
Download Code
Re^6: Named Captures
by BrowserUk (Pope) on Oct 06, 2010 at 15:12 UTC

    Yes. Hence the "sort of". For my purpose, I just needed to ensure that lots of things got captured, I was never going to do anything with them. I was trying to heavily exercise both named captures and alternations in the hope of reproducing a memory leak.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (9)
As of 2015-07-05 17:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (67 votes), past polls