script/pwget.pl untested

filter: Statementstmt 0.0% 0 / 28 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 0.0% 0 / 6 Podpod n/a totaltotal 0.0% 0 / 43 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  
5 use HTTP::Request::FromWget;
6 use LWP::UserAgent;
7 use Getopt::Long ':config','pass_through','no_ignore_case';
8 use Pod::Usage;
9  
10 our $VERSION = '0.57';
11  
12 # parse output options from @ARGV
13 GetOptions(
14 'output-file|O=s' => \my $outfilename,
15 'help|h' => \my $show_help,
16 ) or pod2usage(2);
17  
18 pod2usage(1) if $show_help;
19  
20 my @output_options;
21 if( $outfilename ) {
22 push @output_options, $outfilename;
23 };
24  
25 # now execute all requests
26 my @requests = HTTP::Request::FromWget->new(
27 argv => \@ARGV,
28 read_files => 1,
29 );
30  
31 my $ua = LWP::UserAgent->new();
32  
33 for my $request (@requests) {
34 print
35 $ua->request( $request->as_request, @output_options )->decoded_content;
36 };