Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
My question is this: Is it a bad practice to use $a and $b in both the subroutine, and for sending data to the subroutine? I think it would be OK because they are in different scopes. Does it become a matter of personal preference, or is there an underlying reason this is a bad idea?use strict; while (my $something) { my ($a, $b); testFunc($a, $b); } sub testFunc { my ($a, $b) = @_; ... do something ... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(jeffa) Re: Scalars within Subroutines (scope)
by jeffa (Bishop) on Jul 19, 2002 at 15:39 UTC | |
|
Re: Scalars within Subroutines (scope)
by simeon2000 (Monk) on Jul 19, 2002 at 15:41 UTC | |
|
Re: Scalars within Subroutines (scope)
by broquaint (Abbot) on Jul 19, 2002 at 15:44 UTC | |
|
Re: Scalars within Subroutines (scope)
by Anonymous Monk on Jul 19, 2002 at 17:58 UTC |