icon Top 9 categories map      RocketAware > Perl >

Possible attempt to put comments in qw() list

Tips: Browse or Search all pages for efficient awareness of Perl functions, operators, and FAQs.



Home

Search Perl pages


Subjects

By activity
Professions, Sciences, Humanities, Business, ...

User Interface
Text-based, GUI, Audio, Video, Keyboards, Mouse, Images,...

Text Strings
Conversions, tests, processing, manipulation,...

Math
Integer, Floating point, Matrix, Statistics, Boolean, ...

Processing
Algorithms, Memory, Process control, Debugging, ...

Stored Data
Data storage, Integrity, Encryption, Compression, ...

Communications
Networks, protocols, Interprocess, Remote, Client Server, ...

Hard World
Timing, Calendar and Clock, Audio, Video, Printer, Controls...

File System
Management, Filtering, File & Directory access, Viewers, ...

    
Possible attempt to put comments in qw() list
(W) qw() lists contain items separated by whitespace; as with literal strings, comment characters are not ignored, but are instead treated as literal data. (You may have used different delimiters than the exclamation marks parentheses shown here; braces are also frequently used.)

You probably wrote something like this:

    @list = qw(
        a # a comment
        b # another comment
    );

when you should have written this:

    @list = qw(
        a
        b
    );

If you really want comments, build your list the old-fashioned way, with quotes and commas:

    @list = (
        'a',    # a comment
        'b',    # another comment
    );

Possible attempt to separate words with commas
(W) qw() lists contain items separated by whitespace; therefore commas aren't needed to separate the items. (You may have used different delimiters than the parentheses shown here; braces are also frequently used.)

You probably wrote something like this:

    qw! a, b, c !;

which puts literal commas into some of the list items. Write it without commas if you don't want them to appear in your data:

    qw! a b c !;

Source: what's new for perl5.004
Copyright: Larry Wall, et al.
Next: Scalar value @%s{%s} better written as $%s{%s}

Previous: panic: frexp



(Corrections, notes, and links courtesy of RocketAware.com)


[Overview Topics]

Up to: PERL




Rapid-Links: Search | About | Comments | Submit Path: RocketAware > Perl > perldelta/Possible.htm
RocketAware.com is a service of Mib Software
Copyright 2000, Forrest J. Cavalier III. All Rights Reserved.
We welcome submissions and comments