qw! fred barney betty wilma dino !
qw# fred barney betty wilma dino # # like in a comment!
qw( fred barney betty wilma dino )
qw{ fred barney betty wilma dino }
qw[ fred barney betty wilma dino ]
qw< fred barney betty wilma dino >
As those last four show, sometimes the two delimiters can be
different. If the opening delimiter is one of those
"left" characters, the corresponding "right"
character is the proper closing delimiter. Other delimiters use the
same character for start and finish.
If you need to include the closing delimiter
within the string as one of the characters, you
probably picked the wrong delimeter. But even if you can't or
don't want to change the delimiter, you can still include the
character using the backslash:
qw! yahoo\! google excite lycos ! # include yahoo! as an element
As in single-quoted strings, two consecutive backslashes contribute
one single backslash to the item.
Now, although the Perl motto is "There's More Than One
Way To Do It," you may well wonder why anyone would need all of
those different ways! Well, we'll see later that there are
other kinds of quoting where Perl uses this same rule, and it can
come in handy in many of those. But even here, it could be useful if
you were to need a list of Unix filenames:
qw{
/usr/dict/words
/home/rootbeer/.ispell_english
}
That list would be quite inconvenient to read, write, and maintain if
the slash were the only delimiter available.