git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 2/3] gitweb/gitweb.perl: remove use of qw(...) as parentheses

From
Jakub Narebski <jnareb@gmail.com>
Date
Feb 19, 2011, 15:54 UTC
Message-ID
<201102191654.41601.jnareb@gmail.com>
In-Reply-To
<1298129262-10468-3-git-send-email-avarab@gmail.com>
On Sat, 19 Feb 2011, Ævar Arnfjörð Bjarmason wrote:
> 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.

It is strange that Perl introduces such backwards incompatibile change (well, actually will introduce, as 5.13.x is development branch leading to future Perl version 5.14).

qw{} is described in perlop(1) as "word list" operator, so one would
suppose that it generates a list.
 
Show 6 quoted lines
> 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

Hmmm... does it affect only foreach loop, or dows it affect also other places, like

      use POSIX qw( setlocale localeconv )
      @EXPORT = qw( foo bar baz );
 
Both of those forms are used by gitweb:
      use CGI qw(:standard :escapeHTML -nosticky);
      map { $_ => 'sh'  } qw(bash zsh ksh)
      my @navs = qw(summary shortlog log commit commitdiff tree);
[...]
Show 11 quoted lines
> --- a/gitweb/gitweb.perl
> +++ b/gitweb/gitweb.perl
> @@ -3501,7 +3501,7 @@ sub print_feed_meta {
>  			$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',

I am not against futureproofing gitweb in above way for future Perl 5.14.x

-- 
Jakub Narebski
Poland
Previous: Ævar Arnfjörð BjarmasonNext: Jakub Narebski
Message 10 of 15 in “gitweb/gitweb.perl: remove use of qw(...) as parentheses”
  1. gitweb/gitweb.perl: remove use of qw(...) as parenthesesÆvar Arnfjörð Bjarmason, Feb 19, 2011
  2. 0/3 Fix failure-causing warnings in Gitweb + improve gitweb-lib.shÆvar Arnfjörð Bjarmason, Feb 19, 2011
  3. 1/3 t/gitweb-lib.sh: print to stderr when gitweb_run has errorsÆvar Arnfjörð Bjarmason, Feb 19, 2011
  4. Jakub NarebskiFeb 19, 2011
  5. Ævar Arnfjörð BjarmasonFeb 19, 2011
  6. Jakub NarebskiFeb 19, 2011
  7. Ævar Arnfjörð BjarmasonFeb 19, 2011
  8. Junio C HamanoFeb 21, 2011
  9. 2/3 gitweb/gitweb.perl: remove use of qw(...) as parenthesesÆvar Arnfjörð Bjarmason, Feb 19, 2011
  10. Jakub NarebskiFeb 19, 2011
  11. Jakub NarebskiFeb 19, 2011
  12. Ævar Arnfjörð BjarmasonFeb 19, 2011
  13. Jakub NarebskiFeb 20, 2011
  14. 3/3 gitweb/gitweb.perl: don't call S_ISREG() with undefÆvar Arnfjörð Bjarmason, Feb 19, 2011
  15. Jakub NarebskiFeb 19, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.