Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
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 ) {


Comment on Re: For- loop increment not passing to inner block
Select or Download Code
Re^2: For- loop increment not passing to inner block
by GrandFather (Cardinal) 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 wandering the Monastery: (11)
As of 2014-07-13 17:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (251 votes), past polls