Taking a real life example, I don't see an advantage in using IPC::Run3::Shell::CLIWrapper over AWS::CLIWrapper:
#!/usr/bin/perl
use strict;
use warnings;
use AWS::CLIWrapper;
use Data::Dumper;
my $aws = AWS::CLIWrapper->new(profile => 'my_profile') or
die $AWS::CLIWrapper::Error->{Message};
sub gethosts {
my $name = shift;
my $hosts = $aws->ec2('describe-instances' => {
filters => [{Name => 'tag:Name', Values => [$name]}],
query => 'Reservations[*].Instances[*].{Id:InstanceId,Addr:Pri
+vateIpAddress,Zone:Placement.AvailabilityZone,Name:(Tags[?Key==`Name`
+])[0].Value}'}) or
die "$AWS::CLIWrapper::Error->{Message}";
return [map {@$_} @$hosts];
}
my $hosts = gethosts('*something*');
print Dumper($hosts);
Doesn't this feel very "perlish"? :-)
Maybe I'm missing the point.
Greetings,
-jo
$gryYup$d0ylprbpriprrYpkJl2xyl~rzg??P~5lp2hyl0p$