note
rnahi
<blockquote><i>
It might be useful to skip blank lines (or lines that just contain comments) like the real qw():
</i></blockquote>
That won't be necessary. [split] with a single space is a special case that
splits on any number of whitespace, including newlines.
</p>
<p>Try it for yourself:</p>
<code>
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
sub qwx {
my ( $text ) = @_;
$text =~ s/\s*[#].*$//mg;
return split ' ', $text;
}
my @items = qwx"
this
is # possibly
a # commented
list
# with stand-alone comments
# and empty lines
"
;
print Dumper \@items;
__END__
$VAR1 = [
'this',
'is',
'a',
'list'
];
</code>
529650
529674