Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
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
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 perusing the Monastery: (10)
As of 2015-07-29 12:33 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 (263 votes), past polls