@@ -29,39 +29,35 @@ my %command_line_options = (
2929 images => sub { push ( @actions , \&dump_images ) },
3030 all => sub {
3131 $all ++;
32- push (
33- @actions , \&dump_headers, \&dump_forms, \&dump_links,
34- \&dump_images
35- );
32+ push ( @actions ,
33+ \&dump_headers, \&dump_forms, \&dump_links, \&dump_images );
3634 },
3735 text => sub { push ( @actions , \&dump_text ) },
3836 ' absolute!' => \$absolute ,
3937 ' agent=s' => \$agent ,
4038 ' agent-alias=s' => \$agent_alias ,
4139 ' cookie-file=s' => \$cookie_filename ,
4240 help => sub { pod2usage(1); },
43- version => sub { print STDERR $WWW::Mechanize::VERSION , " \n " ; exit 0; },
44- ' completions' => sub { completions(@ARGV ); },
41+ version => sub { print STDERR $WWW::Mechanize::VERSION , " \n " ; exit 0; },
42+ ' completions' => sub { completions(@ARGV ); },
4543);
46- GetOptions(
47- %command_line_options
48- ) or pod2usage(2);
44+ GetOptions(%command_line_options ) or pod2usage(2);
4945
5046sub completions {
5147 my (@words ) = @_ ;
5248 my @opts ;
53- foreach (sort keys %command_line_options ) {
54- if (m / ^ (?<opt> [^!]{1,}) ! $ / msx ) {
55- push @opts , $+ {opt }, ' no-' . $+ {opt };
49+ foreach ( sort keys %command_line_options ) {
50+ if (m / ^ (?<opt> [^!]{1,}) ! $ / msx ) {
51+ push @opts , $+ {opt }, ' no-' . $+ {opt };
5652 }
57- elsif (m / ^ (?<opt> [^=]{1,}) = [siof] {1} $ / msx ) {
58- push @opts , (split qr {\| } , $+ {opt });
53+ elsif (m / ^ (?<opt> [^=]{1,}) = [siof] {1} $ / msx ) {
54+ push @opts , ( split qr {\| } , $+ {opt } );
5955 }
6056 else {
6157 push @opts , $_ ;
6258 }
6359 }
64- print join " \n " , (map { q{ --} . $_ } @opts );
60+ print join " \n " , ( map { q{ --} . $_ } @opts );
6561 print " \n " ;
6662 exit 0;
6763}
@@ -111,7 +107,7 @@ See L<LWP::UserAgent> for details.
111107=cut
112108
113109my @uris = @ARGV
114- or die " Must specify a URL or file to check. See --help for details.\n " ;
110+ or die " Must specify a URL or file to check. See --help for details.\n " ;
115111
116112@actions = ( \&dump_forms ) unless @actions ;
117113
@@ -126,7 +122,8 @@ elsif ( defined $agent_alias ) {
126122}
127123if ( defined $cookie_filename ) {
128124 my $cookies = HTTP::Cookies-> new(
129- file => $cookie_filename , autosave => 1,
125+ file => $cookie_filename ,
126+ autosave => 1,
130127 ignore_discard => 1
131128 );
132129 $cookies -> load();
@@ -156,8 +153,8 @@ foreach my $uri (@uris) {
156153 $mech -> credentials( $user , $pass );
157154 $response = $mech -> get($uri );
158155 $response -> is_success
159- or die " Can't fetch $uri with username and password\n " ,
160- $response -> status_line, " \n " ;
156+ or die " Can't fetch $uri with username and password\n " ,
157+ $response -> status_line, " \n " ;
161158 }
162159 else {
163160 die " $uri returns status " , $response -> code, " \n " ;
@@ -166,8 +163,8 @@ foreach my $uri (@uris) {
166163
167164 unless ($no_ct_check ) {
168165 $mech -> is_html
169- or die qq{ $uri returns type "} , $mech -> ct,
170- qq{ ", not "text/html"\n } ;
166+ or die qq{ $uri returns type "} , $mech -> ct,
167+ qq{ ", not "text/html"\n } ;
171168 }
172169
173170 foreach my $action (@actions ) {
0 commit comments