in reply to Re^2: Best Multidimensional Hash Practices?
in thread Best Multidimensional Hash Practices?
You are not really sharing data among applications in that case, you are using hash, for what I consider it most useful, internalized data management with limited scope.
The problem is people who use hashes to represent complicated relationships in complicated programs. A lack of restrictions using hashes can make them a nightmare when someone can just put anything anywhere. An example of this,
my $hash{'param'} = 'lh'; # code later $hash{'PARAM'} = $hash{'param'}; # later still print "Param is: " . $hash{'PARAM'} . "\n";
Here an object would have(hopefully) prevented this code from showing up. Someone did not not know about $hash{'param'} but did find $hash{'PARAM'}. Or the person wrote the print statement, it did not work, so included the the second assignment rather than change their print statement(maybe multiple times).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Best Multidimensional Hash Practices?
by gwadej (Chaplain) on Oct 16, 2009 at 14:32 UTC |