laziness, impatience, and hubris | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
References have to be dereferenced to print or iterate
through. Your code was attempting to access an element of the list (array) instead of the entire array. To access a single element of a referenced array you can: print ${$entry->FTs->elements}[$number]Make sure you use 'use strict' it would have thrown an error when the example you gave was used, I am not saying it would be any clearer as to how to solve it but at least you would have a starting point :^) For an array reference you would iterate as: print "$_\n" for @{$entry->FTs->elements};for a hash ref: print "$_ = $hashref->{$_}\n" for keys %{$hashref}; See 'perldoc perlref' for more information. or on the web at: perlref In reply to Re: ask about array and hash
by Anonymous Monk
|
|