Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^4: In Need of Mentoring

by chromatic (Archbishop)
on Jan 16, 2012 at 02:55 UTC ( #948052=note: print w/ replies, xml ) Need Help??


in reply to Re^3: In Need of Mentoring
in thread In Need of Mentoring

... the C-style loop will likely get you scolded on this website.

If you've never made a fencepost error, I salute you. The rest of us mortals seem to benefit from not having to worry about such things.


Improve your skills with Modern Perl: the free book.


Comment on Re^4: In Need of Mentoring
Re^5: In Need of Mentoring
by JavaFan (Canon) on Jan 16, 2012 at 09:22 UTC
    Of course I've made fence post errors. But then on constructs that would be really awkward to do without C-style for loops.

    I don't think I've ever made a fence post error on

    for (my $i = 0; $i < @array; $i++) { ... }
    where I would not modify @array or $i, nor use $i to look elsewhere in the array. But then, this is about the only case where I would not use a C-style for loop, but a Perl style foreach.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (9)
As of 2015-07-07 11:19 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 (88 votes), past polls