lib/auto/share/dist/Amazon-SQS-Client/example.pl untested

filter: Statementstmt 0.0% 0 / 47 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 0.0% 0 / 10 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 74 CC 4 SCAR 20.2
CC
4
Cov
0%
main
20.0
BEGIN
2.0
BEGIN
2.0
CRAP 7.5
1 #!/usr/bin/env perl
2  
3 # Script for exercising Amazon::SQS examples.
4  
5 use strict;
6 use warnings;
7  
8 use Amazon::SQS::Sample;
9 use Data::Dumper;
10 use English qw(-no_match_vars);
11 use Carp qw(carp croak);
12 use Pod::Usage;
13 use Module::Load qw(load);
14  
15 use Getopt::Long qw(:config no_ignore_case);
16  
17 ########################################################################
18 sub main {
19 ########################################################################
20 my %options;
21  
22 my @option_specs = qw(
23 file|f=s
24 help|h
25 endpoint-url|e=s
26 debug|d
27 );
28  
29 my $retval = GetOptions( \%options, @option_specs );
30  
31 if ( !$retval || ( $options{help} && !@ARGV ) ) {
32 pod2usage(1);
33 }
34  
35 my $example = shift @ARGV;
36  
37 load $example;
38  
39 my $sample = $example->new( \%options );
40  
41 if ( $options{help} ) {
42 $sample->help();
43 }
44  
45 eval { $sample->sample(@ARGV); };
46  
47 $sample->check_error($EVAL_ERROR);
48  
49 return 0
50 if !$options{debug};
51  
52 print {*STDERR} Dumper(
53 [ request => $sample->get_service->get_last_request,
54 response => $sample->get_service->get_last_response,
55 credentials => $sample->get_service->get_credentials,
56 ]
57 );
58  
59 return 0;
60 }
61  
62 exit main();
63  
64 1;
65  
66 ## no critic
67  
68 __END__