develooper Front page | perl.bootstrap | Postings from July 2000

Re: Complex Problems vs. Simple Tools

Thread Previous | Thread Next
From:
Tom Christiansen
Date:
July 24, 2000 18:16
Subject:
Re: Complex Problems vs. Simple Tools
Message ID:
3824.964487780@chthon
>I have been reading Camel III and am a little disappointed that it does not 
>recommend -w and strictness as essential to the beginner.  

page 15:

    So like topicalization in a natural language, topicalization in Perl
    "warps" the language that you'll use from there to the end of the program.
    In fact, some of the built-in modules don't actually introduce verbs at
    all, but simply warp the Perl language in various useful ways.  These
    special modules we call I<pragmas>.  For instance, you'll often see people
    use the pragma C<strict>, like this:

	use strict;

    What the C<strict> module does is tighten up some of the rules so that
    you have to be more explicit about various things that Perl would otherwise
    guess about, such as how you want your variables to be scoped.  Making
    things explicit is good when you're working on large projects, because
    by default Perl is optimized for small projects.  But with the C<strict>
    pragma, Perl is also good for large projects that need to be more
    maintainable.  Beyond that, since you can add the C<strict> pragma at any
    time, Perl is also good for evolving small projects into large ones, even
    when you didn't expect that to happen.  Which is usually.

page 20:

    A not-so-random clue: while learning Perl, and even after you think you
    know what you're doing, we suggest using the B<-w> option, especially
    during development.  This option will turn on all sorts of useful and
    interesting warning messages, not necessarily in that order. You can put
    the B<-w> switch on the shebang line, like this:

	#!/usr/bin/perl -w


See also pp 137 and 601, just to name a few.

--tom

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About