script/perl-WebService-Whistle-Pet-Tracker-API-pets.pl untested

filter: Statementstmt 0.0% 0 / 28 Branchbran n/a Conditioncond 0.0% 0 / 10 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 0.0% 0 / 6 Podpod n/a totaltotal 0.0% 0 / 48 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 #!/usr/local/bin/perl
2 use strict;
3 use warnings;
4 use File::Basename qw{basename};
5 use Getopt::Std qw{getopts};
6 use JSON::XS qw{};
7 use WebService::Whistle::Pet::Tracker::API qw{};
8  
9 my $basename = basename($0);
10 my $syntax = "$basename -e WHISTLE_EMAIL -p WHISTLE_PASSWORD #or from environment\n";
11 my $opt = {};
12  
13 getopts('e:p:', $opt);
14  
15 my $email = $opt->{'e'} || $ENV{'WHISTLE_EMAIL'} or die($syntax);
16 my $password = $opt->{'p'} || $ENV{'WHISTLE_PASSWORD'} or die($syntax);
17  
18 my $ws = WebService::Whistle::Pet::Tracker::API->new(email=>$email, password=>$password);
19 my $json = JSON::XS->new->pretty;
20 my $pets = $ws->pets;
21  
22 print $json->encode($pets);
23  
24 __END__