Modern Perl: 2014 Edition by chromatic

Modern Perl: 2014 Edition by chromatic

Author:chromatic
Language: eng
Format: azw3
ISBN: 9780985451943
Publisher: Onyx Neon Press
Published: 2011-12-06T16:00:00+00:00


Interpolation Happens

Without those curly braces, Perl's parser would interpret the variable name as $ascii_vowelst, which either causes a compile-time error about an unknown variable or interpolates the contents of an existing $ascii_vowelst into the regex.

The hyphen character (-) allows you to include a contiguous range of characters in a class, such as this $ascii_letters_only regex:

my $ascii_letters_only = qr/[a-zA-Z]/;

To include the hyphen as a member of the class, use it at the start or end of the class:

my $interesting_punctuation = qr/[-!?]/;



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.