in reply to Re^3: Go to perl::critic
in thread Go to perl::critic

But a labeled block is a single loop, that redo makes infinite. I said outside loops is where goto comes in really handy. I only seem to ever want goto when extending the handling of STDIN of an existing script. Maybe my mind was poisoned by early exposure to BASIC or I just like that Perl has a feature of FORTRAN. Sometimes out of sheer boredom I'll write sweet spaghetti code on purpose because it's fun and easy and, as we all know, good Perl scripts tend to be so perfect they don't require maintenance. =)

Replies are listed 'Best First'.
Re^5: Go to perl::critic
by haukex (Archbishop) on Oct 07, 2019 at 09:13 UTC
    But a labeled block is a single loop, that redo makes infinite. I said outside loops is where goto comes in really handy.

    But the goto means the above code also contains a loop. Think assembly! No blocks, no loop constructs, no ifs, just conditional jumps...

      If you're really worried about the cost of a while loop then maybe Perl isn't the right tool for the job.