use warnings; use strict; use IPC::Run3::Shell::CLIWrapper; use JSON::PP qw/decode_json/; use Data::Dumper; my $s3api = IPC::Run3::Shell::CLIWrapper->new( { fail_on_stderr => 1, stdout_filter => sub { $_=decode_json($_) } }, qw/ aws --profile MyProfile --output json s3api /); my $buckets = $s3api->list_buckets; print Dumper($buckets);