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

strict

use strict;         # Install all three strictures.

use strict "vars";  # Variables must be predeclared
use strict "refs";  # Can't use symbolic references
use strict "subs";  # Bareword strings must be quoted

use strict;         # Install all...
no strict "vars";   # ...then renege on one

use v5.12;          # by default with v5.12.0 or later

This lexically scoped pragma changes some basic rules about what Perl considers to be legal code. Sometimes these restrictions seem too strict for casual programming, such as when you’re just trying to whip up a five-line filter program. The larger your program, the stricter you need to be about it. If you declare a minimum version of perl with use, and that minimum version is v5.12 or later, you get strictures implicitly.

Currently, there are three possible things to be strict about: subs, vars, and refs. If no import list is supplied, all three restrictions are assumed.

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