Branch: refs/heads/book/qw-backslash
  Home:   https://github.com/Perl/perl5
  Commit: 54e647e81a70109d94a8efc8f9cfdbedeee9da14
      
https://github.com/Perl/perl5/commit/54e647e81a70109d94a8efc8f9cfdbedeee9da14
  Author: Philippe Bruhat (BooK) <b...@cpan.org>
  Date:   2025-07-05 (Sat, 05 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 );



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

Reply via email to