Tue, 09 Dec 2008  Quoting and Parsing  Permanent link   "Perl 5
to 6" Lesson 23 - Quoting and Parsing       my @animals = <dog
cat tiger>     # or     my @animals = qw/dog cat tiger/;     #
or      my $interface = q{eth0};     my $ips = q :s :x /ifconfig
$interface/;      # -----------      sub if {         warn "if()
calls a sub\n";    Perl 6 has a powerful mechanism of quoting
strings, you have exact control over what features you want in
your string.  Perl 5 had single quotes, double quotes and
qw(...) (single quotes, splitted on whitespaces) as well as the
q(..) and qq(...) forms which are basically synonyms for single
and double quotes.  Perl 6 in turn defines a quote operator
named Q that can take various modifiers. The :b (backslash)
modifier allows interpolation of backslash escape sequences like
\n, the :s modifier allows interpolation of scalar variables, :c
allows the interpolation of closures ("1 + 2 = { 1 + 2 }") and
so on, :w splits on words as qw/.../ does.  You can arbitrarily
combine those mo