summaryrefslogtreecommitdiff
path: root/pod/perldata.pod
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-03-02 20:52:08 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-03-02 20:52:08 +0000
commit191d61a768175782efd32a263e82c70bcb0d1401 (patch)
tree32ec782bb82009ebbe2bd3be1201200a159352cd /pod/perldata.pod
parent17dba11114e76689984d3af7bcccc9c9707bfeb4 (diff)
downloadperl-191d61a768175782efd32a263e82c70bcb0d1401.tar.gz
move doc about v-strings from perlop to perldata (suggested by
David Dyck <dcd@tc.fluke.com>) p4raw-id: //depot/perl@5452
Diffstat (limited to 'pod/perldata.pod')
-rw-r--r--pod/perldata.pod12
1 files changed, 12 insertions, 0 deletions
diff --git a/pod/perldata.pod b/pod/perldata.pod
index a122d34c80..4dbc76564e 100644
--- a/pod/perldata.pod
+++ b/pod/perldata.pod
@@ -274,6 +274,7 @@ integer formats:
0xff # hex
0377 # octal
0b011011 # binary
+ v102.111.111 # string (made of characters "f", "o", "o")
String literals are usually delimited by either single or double
quotes. They work much like quotes in the standard Unix shells:
@@ -323,6 +324,17 @@ C<$days{Feb}> and the quotes will be assumed automatically. But
anything more complicated in the subscript will be interpreted as
an expression.
+A literal of the form C<v1.20.300.4000> is parsed as a string composed
+of characters with the specified ordinals. This provides an alternative,
+more readable way to construct strings, rather than use the somewhat less
+readable interpolation form C<"\x{1}\x{14}\x{12c}\x{fa0}">. This is useful
+for representing Unicode strings, and for comparing version "numbers"
+using the string comparison operators, C<cmp>, C<gt>, C<lt> etc.
+If there are two or more dots in the literal, the leading C<v> may be
+omitted. Such literals are accepted by both C<require> and C<use> for
+doing a version check. The C<$^V> special variable also contains the
+running Perl interpreter's version in this form. See L<perlvar/$^V>.
+
The special literals __FILE__, __LINE__, and __PACKAGE__
represent the current filename, line number, and package name at that
point in your program. They may be used only as separate tokens; they