File Coverage

script/flickr_dump_stored_config.pl
Criterion Covered Total %
statement 29 31 93.5
branch 3 6 50.0
condition 3 9 33.3
subroutine 6 6 100.0
pod n/a
total 41 52 78.8


line stmt bran cond sub pod time code
1             #!/usr/bin/env perl
2              
3             #-----------------------------
4             # flickr_dump_stored_config.pl
5             #_____________________________
6              
7 1     1   5378 use warnings;
  1         1  
  1         77  
8 1     1   4 use strict;
  1         1  
  1         23  
9 1     1   780 use Data::Dumper;
  1         9563  
  1         117  
10 1     1   562 use Storable qw(store_fd retrieve_fd);
  1         3307  
  1         66  
11 1     1   647 use Getopt::Long;
  1         11717  
  1         5  
12 1     1   591 use Pod::Usage;
  1         58943  
  1         1908  
13              
14 1         132640 my $config;
15 1         2 my $cli_args = {};
16              
17 1         9 GetOptions (
18             $cli_args,
19             'config_in=s',
20             'help',
21             'man',
22             'usage'
23             );
24              
25              
26 1 50       751 if (defined($ARGV[0])) { $cli_args->{'config_in'} = $ARGV[0]; }
  0         0  
27              
28              
29             #-------------------------------------------------------------
30             # Respond to help-type arguments or if missing required params
31             #_____________________________________________________________
32              
33 1 50 33     10 if ($cli_args->{'help'} or $cli_args->{'usage'} or $cli_args->{'man'} or !$cli_args->{'config_in'}) {
      33        
      33        
34              
35 0         0 pod2usage({ -verbose => 2 });
36              
37             }
38              
39              
40              
41 1 50       56 open my $CFG, "<", $cli_args->{'config_in'}
42             or die "Failed to open $cli_args->{'config_in'}: $!";
43              
44 1         6 $config = retrieve_fd($CFG);
45              
46 1         56 close $CFG;
47              
48 1         3 $Data::Dumper::Sortkeys=1;
49              
50 1         5 print "\n\n\n\nRetrieved\n\n",Dumper($config),"\nfrom ",$cli_args->{'config_in'}," using Storable\n\n";
51              
52 1         0 exit;
53              
54             __END__