Skip to Main Content
Perl in a Nutshell, 2nd Edition
book

Perl in a Nutshell, 2nd Edition

by Nathan Patwardhan, Ellen Siever, Stephen Spainhour
June 2002
Beginner content levelBeginner
759 pages
80h 42m
English
O'Reilly Media, Inc.
Content preview from Perl in a Nutshell, 2nd Edition

PerlIO

An on-demand loader for PerlIO layers and the root of the PerlIO namespace. PerlIO allows you to expand the functionality of open(). For example:

use PerlIO 'special';

The code in PerlIO.pm then attempts to find 'special':

require PerlIO::special;

PerlIO currently defines the following layers:

unix

Low-level layer that calls read, write, lseek, etc.

stdio

Calls fread, fwrite, fseek, ftell, etc. stdio will use your operating system’s I/O via the C library. That is, you cannot place any layers beneath stdio.

perlio

A reimplementation of a stdio-like buffering written as a PerlIO layer. As such, it will call whatever layer is below it for its operations.

crlf

Does CRLF translation depending on distinguishing text, and binary files a la MS-DOS.

utf8

Declares that the stream accepts Perl’s internal encoding of characters (which is really UTF-8 on ASCII machines and UTF-EBCDIC on EBCDIC machines). This allows any character Perl can represent to be read from or written to the stream. The UTF- X encoding is chosen to render simple text parts (i.e., nonaccented letters, digits, and common punctuation) human-readable in the encoded file.

raw

A pseudo-layer that performs two functions. It forces the filehandle to be considered binary at that point in the layer stack, and it prevents the I/O system from searching before it in the layer specification. For example:

open($fh,":raw:perlio",...);

raw forces the use of the perlio layer even if the platform default or the use open default is something else (such ...

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

Perl by Example, Fourth Edition

Perl by Example, Fourth Edition

Ellie Quigley
Perl Cookbook, 2nd Edition

Perl Cookbook, 2nd Edition

Tom Christiansen, Nathan Torkington
Perl in a Nutshell

Perl in a Nutshell

Nathan Patwardhan, Ellen Siever, Stephen Spainhour
Learning Perl, 7th Edition

Learning Perl, 7th Edition

Randal L. Schwartz, brian d foy, Tom Phoenix

Publisher Resources

ISBN: 0596002416Errata Page