home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


Perl CookbookPerl CookbookSearch this book

0.5. Conventions Used in This Book

0.5.1. Programming Conventions

We give lots of examples, most of which are pieces of code that should go into a larger program. Some examples are complete programs, which you can recognize because they begin with a #! line. We start nearly all of our longer programs with:

#!/usr/bin/perl -w
use strict;

or else the newer:

#!/usr/bin/perl 
use strict;
use warnings;

Still other examples are things to be typed on a command line. We've used % to show the shell prompt:

% perl -e 'print "Hello, world.\n"'
Hello, world.

This style represents a standard Unix command line, where single quotes represent the "most quoted" form. Quoting and wildcard conventions on other systems vary. For example, many command-line interpreters under MS-DOS and VMS require double quotes instead of single ones to group arguments with spaces or wildcards in them.



Library Navigation Links

Copyright © 2003 O'Reilly & Associates. All rights reserved.