in reply to Re: Perl Programming guidlines/rules
in thread Perl Programming guidelines/rules
I support using $_, but you should perhaps implement a standard/guideline in the form of 'Localize $_ in all user created subs', as something like the following:
Which looks fairly innocuous in the use of $_ to avoid more temporary vars (It's not an extremely good example, but it serves), but then you do something likemap{foo($_->[0]);$_;} which can return wildly different results then you expected, and lead to many.. interesting.. bugs.sub foo{my $blah=shift; $_=substr $blah,0,1; /foo/;}
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Re: Perl Programming guidlines/rules
by belden (Friar) on Nov 22, 2002 at 17:13 UTC | |
by Aristotle (Chancellor) on Nov 27, 2002 at 15:38 UTC | |
by belden (Friar) on Dec 03, 2002 at 16:38 UTC |
In Section
Meditations