Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

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

by blazar (Canon)
on Aug 20, 2007 at 20:44 UTC ( #633936=note: print w/replies, xml ) Need Help??

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

The thing that is still missing in the Perl core for me is more flow control resp. non-linear flow:

One thing that I miss both in Perl 5, 6 and most languages I know of is some form of addomesticated code rewriting. We're all told that goto is evil. But we have some forms of addomesticated goto: next, last and redo, which are not evil. We're all told that code rewriting is evil. But I'm sure that there could be useful and not evil forms of code rewriting. Limbic~Region speaks about that in Doing "it" only once.

  • Comment on Re^2: what would you like to see in perl5.12?

Replies are listed 'Best First'.
Re^3: what would you like to see in perl5.12?
by TimToady (Parson) on Aug 21, 2007 at 17:02 UTC
    START blocks provide "do once" capability in Perl 6.
      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; }
        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://633936]
and all is calm...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (4)
As of 2018-01-21 05:32 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (227 votes). Check out past polls.