Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: For- loop increment not passing to inner block

by FunkyMonk (Canon)
on Mar 30, 2008 at 21:42 UTC ( #677399=note: print w/ replies, xml ) Need Help??


in reply to For- loop increment not passing to inner block

Since nobody's mentioned it yet
for (my $i = 0; $i <= 4; $i++) {

is more idiomatically written

for my $i ( 0 .. 4 ) {

Replies are listed 'Best First'.
Re^2: For- loop increment not passing to inner block
by GrandFather (Sage) on Mar 30, 2008 at 21:47 UTC

    Not only more Perlish (idiomatically), but shorter, clearer, safer and more maintainable - what's not to like?.


    Perl is environmentally friendly - it saves trees

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2016-06-28 07:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (350 votes). Check out past polls.