develooper Front page | perl.perl5.porters | Postings from April 2010

Re: RFC: Perl manual pages -- update to follow the perlstyle.podguidelines

Thread Previous | Thread Next
From:
Aristotle Pagaltzis
Date:
April 3, 2010 12:58
Subject:
Re: RFC: Perl manual pages -- update to follow the perlstyle.podguidelines
Message ID:
20100403195629.GA5903@klangraum.plasmasturm.org
* Jari Aalto <jari.aalto@cante.net> [2010-04-03 20:20]:
> About the "my" everywhere int the loops, I'd suggest adding it
> everywhere, so that the "quick reader" always sees it:
>
>     for my $var ...

I would agree. `foreach` always aliases the iterator to the list
items, rather than copying. That means when you use a predeclared
variable, its old value will be shadowed during the loop and
restored afterwards. I have never had any use for this behaviour
(other than for the fact that this makes `foreach` the safest way
to make use of `$_`) and I strongly doubt it is something we want
novices to be concerned with. And the clutter it might add to the
examples is so minimal as to be of no concern.

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About