in reply to # in qw
Reading that last part, it sounds like '#' will cause a warning in qw no matter what (well as long as warnings are on)qw/STRING/ Returns a list of the words extracted out of STRING, using embedded wh +itespace as the word delimiters. It is exactly equivalent to split(' ', q/STRING/); This equivalency means that if used in scalar context, you'll get spli +t's (unfortunate) scalar context behavior, complete with mysterious warnings. Some frequently seen examples: use POSIX qw( setlocale localeconv ) @EXPORT = qw( foo bar baz ); A common mistake is to try to separate the words with comma or to put +comments into a multi-line perlman:perlop-string. For this reason the -w switch produc +e warnings if the STRING contains the ``,'' or the ``#'' character.
Looks like you might be stuck with something like:
As in:split(' ',q/#FF0000 #00FF00 #0000FF/)
note, the warning is from the original style qw quoting... comment that out, and the warning will be gone. </code>#!/usr/bin/perl -wT use strict; print "$_ " for (qw ( #FF0000 #00FF00 #0000FF )); print "\n"; print "$_ " for (split(' ',q/#FF0000 #00FF00 #0000FF/)); print "\n"; =output Possible attempt to put comments in qw() list at ./qw.pl line 4. #FF0000 #00FF00 #0000FF #FF0000 #00FF00 #0000FF
-Blake
|
|---|