Is there any other way of handling this data...
Since all the "captureID" values are unique, and these are the values that you want to use for fetching information about a given entry, I guess the question is, "why use an array at all?" I think a HoH (or even a simple hash) would work just as well:
my %outputFiles; sub setOutputFile { my ($id,$path,$type) = @_; # HoH method: $outputFiles{$id}{path} = $path; $outputFiles{$id}{type} = $type; # or, simple hash method: # $outputFiles{$id} = join "=:=", $type, $path; } sub getOutputFiles { my $id = shift; # HoH method: my $type = $outputFiles{$id}{type}; my $path = $outputFiles{$id}{path}; # or, simple hash method: # my ( $type, $path ) = split /=:=/, $outputFiles{$id}; # ... do something with $path and $type ... }
In reply to Re^3: Array of Hashes
by graff
in thread Array of Hashes
by ramya2005
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |