Some of our conventions get larger sections of their very own. Coding conventions are discussed in Section 0.3, "Programming with Style" in Chapter 24, "Common Practices". In a sense, our lexical conventions are given in the Glossary (our lexicon).
The following typographic conventions are used in this book:
is used for URLs, manpages, pathnames, and programs. New terms are also italicized when they first appear in the text. Many of these terms will have alternative definitions in the Glossary if the one in the text doesn't do it for you.
is used in examples and in regular text to show any literal code. Data values are represented by constant width in quotes (""), which are not part of the value.
is used for command-line switches. This allows one to distinguish for example, between the -w warnings switch and the -w filetest operator. It is also used in the examples to indicate the text you type in literally.
is used for generic code terms for which you must substitute particular values.
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:
Still other examples are things to be typed on a command line. We've used % to indicate a generic shell prompt:#!/usr/bin/perl
This style is representative of 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 quotes when you need to group arguments with spaces or wildcards in them.% perl -e 'print "Hello, world.\n"' Hello, world.
Copyright © 2001 O'Reilly & Associates. All rights reserved.
HIVE: All information for read only. Please respect copyright! |