sloppyhack
Technical User
I am trying to capture a hash from an array of hashes and assign it to one hash. It's not working, but I know it's possible. Here's an example.
my @dups; #my array containing hashes
I want to pash one hash from this array into a hash variable.
$lgth1 = length $dups[$row]->{'ITDESC'}; #assign length value..this works
if ($lgth1 >= $lgth2) {
%best = $dups[$row]; #this may be the problem..trying to assign one row of the array (a hash) to the hash variable
}
print "$best{'ITDESC'}\n"; #this doesn't print anything
Cheers,
Sloppyhack
my @dups; #my array containing hashes
I want to pash one hash from this array into a hash variable.
$lgth1 = length $dups[$row]->{'ITDESC'}; #assign length value..this works
if ($lgth1 >= $lgth2) {
%best = $dups[$row]; #this may be the problem..trying to assign one row of the array (a hash) to the hash variable
}
print "$best{'ITDESC'}\n"; #this doesn't print anything
Cheers,
Sloppyhack