It looks like in Paws::CloudWatch::DescribeAlarmsOutput it tells you that object contains an attribute that holds an arrayref where each element of the array is an object of the type Paws::CloudWatch::MetricAlarm. So you can deref the arrayref and loop through with foreach and inspect the attributes of MetricAlarm.
Update: Try this to see what you get.
2nd Update: I forgot to access the attribute MetricAlarms. This is all untested but should give you an idea.
3rd Update: Added print AlarmName attribute.
Update: Fixed brackets after @.
sub describe_alarms { my ($alarm_name_prefix) = @_; my $obj = Paws->service( 'CloudWatch', region => 'us-east-1' ); my $result = $obj->DescribeAlarms( AlarmNamePrefix => $alarm_name_prefix, ); #foreach(@$result){ Updated foreach( @{ $result->MetricAlarms } ){ print "-"x79,"\n"; print "**AlarmName** : ", $_->AlarmName,"\n"; print Dumper($_); } print "\n***\n--number of elements: ", scalar @{ $result->MetricAl +arms }, "\n"; return $result; }
In reply to Re: Paws result how to process?
by Lotus1
in thread Paws result how to process?
by bigswifty00000
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |