Skip to Content
Programming Perl, 4th Edition
book

Programming Perl, 4th Edition

by Tom Christiansen, brian d foy, Larry Wall, Jon Orwant
February 2012
Intermediate to advanced
1184 pages
37h 17m
English
O'Reilly Media, Inc.
Content preview from Programming Perl, 4th Edition

glob

glob EXPR
glob

This function returns the value of EXPR with filename expansions the way a shell would expand them. This is the internal function implementing the <*> operator.

For historical reasons, the algorithm matches the csh(1)’s style of expansion, not the Bourne shell’s. Files whose first character is a dot (“.”) are ignored unless this character is explicitly matched first. An asterisk (“*”) matches any sequence of any character (including none). A question mark (“?”) matches any one character. A square bracket sequence (“[]”) specifies a simple character class, like “[chy0–9]”. Character classes may be negated with a circumflex, as in “*.[^oa]”, which matches any file with an extension consisting of a period followed by one character that is neither an “a” nor an “o”. A tilde (“~”) expands to a home directory, as in “~/.*rc” for all the current user’s “rc” files, or “~jane/Mail/*” for all of Jane’s mail files. Braces may be used for alternation, as in “~/.{mail,ex,csh,twm,}rc” to get those particular rc files.

The glob function grandfathers the use of whitespace to separate ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Programming Perl, 3rd Edition

Programming Perl, 3rd Edition

Larry Wall, Tom Christiansen, Jon Orwant
Programming the Perl DBI

Programming the Perl DBI

Tim Bunce, Alligator Descartes
Learning Perl, 8th Edition

Learning Perl, 8th Edition

Randal L. Schwartz, brian d foy, Tom Phoenix
Learning Perl, 7th Edition

Learning Perl, 7th Edition

Randal L. Schwartz, brian d foy, Tom Phoenix

Publisher Resources

ISBN: 9781449321451Supplemental ContentErrata Page