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

Name

new

Synopsis

new(%option)

Constructor. Options are passed as keyword/value pairs. Recognized options are:

Style

Sets the type of parser. The built-in styles are Debug, Subs, Tree, Objects, and Stream. Custom styles can be provided by giving a fully qualified package name containing at least one “::”. This package must have subroutines defined for each parser type.

Handlers

An anonymous hash containing the handler types as the keys with their associated values, which are references to subroutines for handling that type of event.

Pkg

Some styles will refer to subroutines defined in the specified package.

ErrorContext

The number of lines to show surrounding the line in which an error occurred.

ProtocolEncoding

Sets the protocol-encoding name (default is none). The built-in encodings are UTF-8, ISO-8859-1, UTF-16, and US-ASCII. You may introduce additional encodings by adding directories to @Encoding_Path.

Namespaces

If true, then namespace processing is done during the parse.

NoExpand

Normally, the parser will try to expand references to entities defined internally. If this option is true and a default handler is also set, then the default handler will be called when an entity reference is encountered.

Stream_Delimiter

A string for XML::Parser to interpret as end-of-file if found alone on a line. Useful when working with MIME multipart documents. The string should not contain a trailing newline.

ParseParamEnt

Unless standalone is set to yes in the XML declaration, setting this to true allows the ...

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