]> Lady’s Gitweb - Gitweb/commitdiff
gitweb/gitweb.perl: remove use of qw(...) as parentheses
authorÆvar Arnfjörð Bjarmason <redacted>
Sat, 19 Feb 2011 15:27:41 +0000 (15:27 +0000)
committerLady <redacted>
Mon, 6 Apr 2026 04:51:30 +0000 (00:51 -0400)
Using the qw(...) construct as implicit parentheses was deprecated in
perl 5.13.5. Change the relevant code in gitweb to not use the
deprecated construct. The offending code was introduced in 3562198b by
Jakub Narebski.

The issue is that perl will now warn about this:

    $ perl -wE 'for my $i qw(a b) { say $i }'
    Use of qw(...) as parentheses is deprecated at -e line 1.
    a
    b

This caused gitweb.perl to warn on perl 5.13.5 and above, and these
tests to fail on those perl versions:

    ./t9501-gitweb-standalone-http-status.sh           (Wstat: 256 Tests: 11 Failed: 10)
      Failed tests:  2-11
      Non-zero exit status: 1
    ./t9502-gitweb-standalone-parse-output.sh          (Wstat: 256 Tests: 10 Failed: 9)
      Failed tests:  2-10
      Non-zero exit status: 1

Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
Acked-by: Jakub Narębski <redacted>
Signed-off-by: Junio C Hamano <redacted>
gitweb.perl

index 9a102749f91a91a3cac567a076e5f272e9a29797df4cedeb112db3cd21ec18f5..bee3a5a4ff2d97670a58687b86bad96bdb32757af82a04eb764991ee9068ac97 100755 (executable)
@@ -3502,7 +3502,7 @@ sub print_feed_meta {
                        $href_params{'-title'} = 'log';
                }
 
                        $href_params{'-title'} = 'log';
                }
 
-               foreach my $format qw(RSS Atom) {
+               foreach my $format (qw(RSS Atom)) {
                        my $type = lc($format);
                        my %link_attr = (
                                '-rel' => 'alternate',
                        my $type = lc($format);
                        my %link_attr = (
                                '-rel' => 'alternate',
@@ -3683,7 +3683,7 @@ sub git_footer_html {
                }
                $href_params{'-title'} ||= 'log';
 
                }
                $href_params{'-title'} ||= 'log';
 
-               foreach my $format qw(RSS Atom) {
+               foreach my $format (qw(RSS Atom)) {
                        $href_params{'action'} = lc($format);
                        print $cgi->a({-href => href(%href_params),
                                      -title => "$href_params{'-title'} $format feed",
                        $href_params{'action'} = lc($format);
                        print $cgi->a({-href => href(%href_params),
                                      -title => "$href_params{'-title'} $format feed",
This page took 0.245942 seconds and 4 git commands to generate.