diff options
author | Nick Ing-Simmons <nik@tiuk.ti.com> | 2001-01-21 11:51:07 +0000 |
---|---|---|
committer | Nick Ing-Simmons <nik@tiuk.ti.com> | 2001-01-21 11:51:07 +0000 |
commit | 52265d3151772e94ddec71ce5f4d46e7950012b7 (patch) | |
tree | d1b72160b6c3d2e4bea711b66a86220ed5a68d31 /pod/perlop.pod | |
parent | a567e93b903bc9849952c06533059c2f2e2fb226 (diff) | |
parent | 6b1bfb713ee2240cea7837d56bcc692b587c8cfb (diff) | |
download | perl-52265d3151772e94ddec71ce5f4d46e7950012b7.tar.gz |
Integrate mainline.
p4raw-id: //depot/perlio@8495
Diffstat (limited to 'pod/perlop.pod')
-rw-r--r-- | pod/perlop.pod | 66 |
1 files changed, 39 insertions, 27 deletions
diff --git a/pod/perlop.pod b/pod/perlop.pod index 0bb506ddc7..ebe52c568e 100644 --- a/pod/perlop.pod +++ b/pod/perlop.pod @@ -645,6 +645,7 @@ any pair of delimiters you choose. Customary Generic Meaning Interpolates '' q{} Literal no "" qq{} Literal yes + qu{} Literal yes, Unicode `` qx{} Command yes (unless '' is delimiter) qw{} Word list no // m{} Pattern match yes (unless '' is delimiter) @@ -1011,6 +1012,44 @@ Options are: See L<perlre> for additional information on valid syntax for STRING, and for a detailed look at the semantics of regular expressions. +=item qw/STRING/ + +Evaluates to a list of the words extracted out of STRING, using embedded +whitespace as the word delimiters. It can be understood as being roughly +equivalent to: + + split(' ', q/STRING/); + +the difference being that it generates a real list at compile time. So +this expression: + + qw(foo bar baz) + +is semantically equivalent to the list: + + 'foo', 'bar', 'baz' + +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 C<qw>-string. For this reason, the +C<use warnings> pragma and the B<-w> switch (that is, the C<$^W> variable) +produces warnings if the STRING contains the "," or the "#" character. + +=item qu/STRING/ + +Like L<qq> but generates Unicode for characters whose code points are +greater than 128, or 0x80. Such characters can be generated using +the \xHH (for characters 0x80...0xff, or 128..255) and \x{HHH...} +notations (for characters 0x100..., or greater than 256). + +(In qq/STRING/, or "", both the \xHH and the \x{HHH...} generate +bytes for the 0x80..0xff range (these bytes are host-dependent), +and the \x{HHH...} can be used to generate Unicode.) + =item qx/STRING/ =item `STRING` @@ -1092,33 +1131,6 @@ Just understand what you're getting yourself into. See L<"I/O Operators"> for more discussion. -=item qw/STRING/ - -Evaluates to a list of the words extracted out of STRING, using embedded -whitespace as the word delimiters. It can be understood as being roughly -equivalent to: - - split(' ', q/STRING/); - -the difference being that it generates a real list at compile time. So -this expression: - - qw(foo bar baz) - -is semantically equivalent to the list: - - 'foo', 'bar', 'baz' - -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 C<qw>-string. For this reason, the -C<use warnings> pragma and the B<-w> switch (that is, the C<$^W> variable) -produces warnings if the STRING contains the "," or the "#" character. - =item s/PATTERN/REPLACEMENT/egimosx Searches a string for a pattern, and if found, replaces that pattern |