in reply to traversing a list of objects
$resp is a reference to a hash, not a hash, so
print $resp->{...
or
print $$resp{...
Also, You seem to not have noticed the [, so
print $resp->{xmlref}{Details}[$i]{ReleaseDate}
or
print $$resp{xmlref}{Details}[$i]{ReleaseDate}
To print release date of all items:
print($_->{ReleaseDate}, $/) foreach (@{$$resp{xmlref}{Details}});
To store the release dates of all items into an array:
@release_dates = map { $_->{ReleaseDate} } @{$$resp{xmlref}{Details}};
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: traversing a list of objects
by dragonchild (Archbishop) on Dec 08, 2004 at 13:32 UTC |