- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
V-Strings in Perl
A literal of the form v1.20.300.4000 is parsed as a string composed of characters with the specified ordinals. This form is known as v-strings.
A v-string provides an alternative and more readable way to construct strings, rather than use the somewhat less readable interpolation form "\x{1}\x{14}\x{12c}\x{fa0}".
They are any literal that begins with a v and is followed by one or more dot-separated elements. For example −
Example
#!/usr/bin/perl $smile = v9786; $foo = v102.111.111; $martin = v77.97.114.116.105.110; print "smile = $smile\n"; print "foo = $foo\n"; print "martin = $martin\n";
Output
This will also produce the same result −
smile = ☺ foo = foo martin = Martin Wide character in print at main.pl line 7.
- Related Articles
- Multiline Strings in Perl
- Transform Perl Strings into Arrays
- Transform Perl Arrays to Strings
- Comments in Perl
- Whitespaces in Perl
- Dereferencing in Perl
- "Here" Documents in Perl
- Escaping Characters in Perl
- Creating Variables in Perl
- Array Size in Perl
- Sorting Arrays in Perl
- Merging Arrays in Perl
- Creating Hashes in Perl
- The ? : Operator in Perl
- GMT Time in Perl

Advertisements