I've been using AWS::CLIWrapper for some time.
Thank you for pointing this out, it inspired me to release IPC::Run3::Shell::CLIWrapper, which is a more generic tool, but allows me to write my previous example as the following. The set-up may look a little more complicated, but the actual calls are much simplified. And since I wrote IPC::Run3::Shell, I can be certain of its behavior :-)
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);
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|