Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re^4: what would you like to see in perl5.12?

by blazar (Canon)
on Aug 21, 2007 at 17:47 UTC ( #634151=note: print w/replies, xml ) Need Help??

in reply to Re^3: what would you like to see in perl5.12?
in thread what would you like to see in perl5.12?

START blocks provide "do once" capability in Perl 6.

Whoa! I will stop complaining like whatever the common English idiom for a recurring, annoying and insisting whiner is.

Would someone care how it would apply to the original (Perl 5) example?

while ( <FH> ) { next if $_ eq 'foo'; # Where foo can only appear once in the file print; }

Replies are listed 'Best First'.
Re^5: what would you like to see in perl5.12?
by TimToady (Parson) on Aug 21, 2007 at 18:31 UTC
    That's not a "do once", that's a "test true once". So you'd want something more like a flipflop operator:
    next if ($_ eq 'foo') ff False;
    Presumably the compiler can recognize that the False test will never be true.

    Those parens bother me though. Maybe the flipflop should be of looser precedence...say, the same precedence as ??!! perhaps... Hmm...

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://634151]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (6)
As of 2018-06-24 18:28 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (126 votes). Check out past polls.