in reply to Re: help! Please please help!
in thread help! Please please help!

I should point out that one may not embed comments in a qw(), as your example might tend to suggest. Doing so (with warnings enabled) will cause the "Possible attempt to put comments in qw() list" warning to be issued.

Actually, you can, but I don't think the results will be what you expected.

• another intruder with the mooring in the heart of the Perl

Replies are listed 'Best First'.
Re^3: help! Please please help!
by Fletch (Bishop) on Mar 14, 2008 at 14:15 UTC

    That's one of the reasons why when I start getting a qw// that's spanning more than 2-ish lines I've taken to changing to using YAML::Syck in a here-doc sort of like this:

    use YAML::Syck qw( Load ); my @servers = @{ Load( <<'EOT' ) }; ## Now I can have comments - 213.123.20.134 - 213.123.20.119 - 213.123.20.120 - 213.123.20.121 EOT

    If the list grows even longer you can easily move it after your __END__ token and change to my $server_data = do { local $/; <DATA> };  my @servers = @{ Load( $server_data ) };; and it's not a big step from there to swap to a separate data file and use LoadFile instead.

    The cake is a lie.
    The cake is a lie.
    The cake is a lie.

Re^3: help! Please please help!
by amarquis (Curate) on Mar 14, 2008 at 14:32 UTC

    Thanks for the correction, I'm sure it will save me some bug hunting someday :). I've never put a comment inside a qw() before and had never really thought about it before.