in reply to Re^2: Paws result how to process?
in thread Paws result how to process?

It was untested code so I messed up the brackets to the right of '@'. It needs to be curly braces '{}' in that case.

foreach( @{$result->MetricAlarms} ){ print "-"x79,"\n"; print "**AlarmName** : ", $_->AlarmName,"\n"; print Dumper($_); } print "\n***\n--number of elements: ", scalar @{$result->MetricAla +rms}, "\n";

Alternatively you can use an intermediate variable to hold the array ref before de-referencing it.

my $ar_ref = $result->MetricAlarms; foreach( @$ar_ref ){ ...

This article shows how to use the curly braces for dereferencing things. Also have a look at this node and this article in the Perl docs.

Replies are listed 'Best First'.
Re^4: Paws result how to process?
by bigswifty00000 (Beadle) on Aug 01, 2018 at 17:22 UTC

    I had replaced curly braces, but still didn't seem to work, but it does now!!

    Thanks Again!