in reply to Re^5: Warnings on unused variables?
in thread Warnings on unused variables?
Because it is easier for maintenance to name them from the beggining.
Suppose you use my (undef, $d, undef, $f) = @_; and 2 months later you also need another variable. Then you need to go look to what code calls is then try to add the argument there - or find another way of passing it - and ultimetly find out it is already being passed as the 3th argument.
A real live example is from a mod_perl framework that uses: my ($data, $p, $r, $dbh) = @_;.
The explenation of the variables:
What you call an advantage I call a serious disadvantage for maintenance. If you later need $r for some reason you need to look up as which argument it is passed.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^7: Warnings on unused variables?
by JavaFan (Canon) on Oct 02, 2008 at 16:15 UTC | |
Re^7: Warnings on unused variables?
by AZed (Monk) on Oct 02, 2008 at 16:00 UTC |