in reply to comments and qw
It should not be to hard to implement, since there is a similar mechanism to allow comments in regular expressions with the /x modifier.
Here is a quick example of a qwx function.
#!/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 ' ); print Dumper \@items; __END__ $VAR1 = [ 'this', 'is', 'a', 'list' ];
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: comments and qw
by ikegami (Patriarch) on Feb 12, 2006 at 19:10 UTC | |
by rnahi (Curate) on Feb 12, 2006 at 20:32 UTC | |
by ikegami (Patriarch) on Feb 13, 2006 at 03:08 UTC |
In Section
Seekers of Perl Wisdom