http://qs1969.pair.com?node_id=677399


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