Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: Flip-flop won't DWIM

by Roy Johnson (Monsignor)
on May 21, 2009 at 20:30 UTC ( #765543=note: print w/ replies, xml ) Need Help??


in reply to Re: Flip-flop won't DWIM
in thread Flip-flop won't DWIM

So use the match-once operator (no need for an actual pattern; the empty pattern works fine):

print join ' ', grep scalar(??../D/), ('A'..'F');

Caution: Contents may have been coded under pressure.


Comment on Re^2: Flip-flop won't DWIM
Download Code
Re^3: Flip-flop won't DWIM
by wu-lee (Beadle) on May 22, 2009 at 10:54 UTC
    Aha! Finally, a use for the match-once operator! And it seems to be tailor made for this problem. Bravo!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (10)
As of 2015-07-06 23:21 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 (85 votes), past polls