Re: Iterate through a hashref using XML::Simple (real post)



On Jun 14, 6:26 am, chas.ow...@xxxxxxxxx (Chas Owens) wrote:

However, I bet you want to iterator over all of the contents of the
RejectRecord key like this

my $max = @{$ref->{RejectRecord}};
for my $i (1 .. $max) {
print "record $i of $max failed because
$ref->{RejectRecord}[$i-1]{Reason}\n";



}- Hide quoted text -

- Show quoted text -
Oh, one other thing.. What If I wanted to iterate over the "Code" tag
as well? Notice there is 2 Code tags that mean different things. One
is the Customer unique identifier ("LarryBoy") and the other is the
Reject Code ("1234"). I am interested in iterating through the
Customer Code.
Thanks again for your help!
Ray

.