in reply to Confusion in naming variables in subroutines
Although they are separate variables in memory, they contain the same values (ie. refer to the same measurements), so it makes perfect sense to name them the same. Besides which, the names are nice and descriptive, so having them named anything else would only be potentially confusing.
The important thing is, of course, that you've correctly used my to declare the lexical versions, scoped to the subroutine. To be even more safe, I'd recommend use strict; and use warnings; at the top of the program.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Confusion in naming variables in subroutines
by Anonymous Monk on Jan 24, 2007 at 01:28 UTC |