Branch: refs/heads/book/qw-backslash
  Home:   https://github.com/Perl/perl5
  Commit: 60bb8367ff8f731764727cec9f07ae7e52be02f3
      
https://github.com/Perl/perl5/commit/60bb8367ff8f731764727cec9f07ae7e52be02f3
  Author: Philippe Bruhat (BooK) <b...@cpan.org>
  Date:   2025-07-09 (Wed, 09 Jul 2025)

  Changed paths:
    M pod/perldiag.pod
    M t/lib/warnings/toke
    M toke.c

  Log Message:
  -----------
  add a new warning against using \ in qw()

I've seen AI-generated code try to use qw() to create lists containing
strings with embedded whitespace using qw and \ to "protect" the
whitespace. Things like:

    my @list = qw(
        foo
        bar\ baz
    );

Just like occurences of ',' and '#', I believe this should warn.

Note that the warning will only be emitted when the \ is followed by
actual whitespace, so code like the following (from lib/App/Cpan.pm)
will not warn:

    my $epic_fail_words = join '|',
            qw( Error stop(?:ping)? problems force not unsupported
                    fail(?:ed)? Cannot\s+install );


  Commit: 486d8590de9d0824ef77d99817e543391b751f1e
      
https://github.com/Perl/perl5/commit/486d8590de9d0824ef77d99817e543391b751f1e
  Author: Philippe Bruhat (BooK) <b...@cpan.org>
  Date:   2025-07-09 (Wed, 09 Jul 2025)

  Changed paths:
    M pod/perldelta.pod

  Log Message:
  -----------
  add perldelta entry for the new qw warning


Compare: https://github.com/Perl/perl5/compare/ee06f66cffe6...486d8590de9d

To unsubscribe from these emails, change your notification settings at 
https://github.com/Perl/perl5/settings/notifications

Reply via email to