in reply to Need to print bucket and filename which is uploaded on S3 storage
Hello coolsaurabh,
I’m assuming that “line 16” is this one:
my @buckets = @{$conn->buckets->{buckets} || []};
Now, the documentation for the Amazon::S3::buckets method says it “Returns undef on error, else HASHREF of results.” So you need to test for an undef return value before attempting to dereference the hash reference. For example:
my $result = $conn->buckets(); my @buckets; @buckets = @{ $result->{buckets} } if defined $result;
This way, if the call to buckets() returns undef, no dereference is attempted and @buckets remains unchanged as an empty list.
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
|
|---|