Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: For- loop increment not passing to inner block

by FunkyMonk (Chancellor)
on Mar 30, 2008 at 21:42 UTC ( [id://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 (Saint) 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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://677399]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (2)
As of 2024-04-20 12:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found