summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-02-04 07:13:19 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-02-04 07:13:19 +0000
commit0b8d69e96040ec811c067522a2d9770121123a35 (patch)
tree3be4b5a4278a3a03b7e60d61552fcf445b223c1f
parentad8f3710f2802efb48c211f82dc482740d43ba02 (diff)
downloadperl-0b8d69e96040ec811c067522a2d9770121123a35.tar.gz
pod updates (from David Adler, M J T Guy)
p4raw-id: //depot/perl@4979
-rw-r--r--pod/perlfaq2.pod2
-rw-r--r--pod/perlop.pod2
-rw-r--r--pod/perlsyn.pod41
3 files changed, 27 insertions, 18 deletions
diff --git a/pod/perlfaq2.pod b/pod/perlfaq2.pod
index 80b150d89c..3b0a79ffee 100644
--- a/pod/perlfaq2.pod
+++ b/pod/perlfaq2.pod
@@ -344,7 +344,7 @@ following list is I<not> the complete list of CPAN mirrors.
Most of the major modules (Tk, CGI, libwww-perl) have their own
mailing lists. Consult the documentation that came with the module for
-subscription information. Perl Mongers attempts to maintain a
+subscription information. The Perl Mongers attempt to maintain a
list of mailing lists at:
http://www.perl.org/support/online_support.html#mail
diff --git a/pod/perlop.pod b/pod/perlop.pod
index 68113b79c1..150813e711 100644
--- a/pod/perlop.pod
+++ b/pod/perlop.pod
@@ -789,7 +789,7 @@ the trailing delimiter. This avoids expensive run-time recompilations,
and is useful when the value you are interpolating won't change over
the life of the script. However, mentioning C</o> constitutes a promise
that you won't change the variables in the pattern. If you change them,
-Perl won't even notice. See also L<qr//>.
+Perl won't even notice. See also L<"qr//">.
If the PATTERN evaluates to the empty string, the last
I<successfully> matched regular expression is used instead.
diff --git a/pod/perlsyn.pod b/pod/perlsyn.pod
index 1f3ae50f2d..f07bdfeabf 100644
--- a/pod/perlsyn.pod
+++ b/pod/perlsyn.pod
@@ -5,21 +5,14 @@ perlsyn - Perl syntax
=head1 DESCRIPTION
A Perl script consists of a sequence of declarations and statements.
-The only things that need to be declared in Perl are report formats
-and subroutines. See the sections below for more information on those
-declarations. All uninitialized user-created objects are assumed to
-start with a C<null> or C<0> value until they are defined by some explicit
-operation such as assignment. (Though you can get warnings about the
-use of undefined values if you like.) The sequence of statements is
-executed just once, unlike in B<sed> and B<awk> scripts, where the
-sequence of statements is executed for each input line. While this means
-that you must explicitly loop over the lines of your input file (or
-files), it also means you have much more control over which files and
-which lines you look at. (Actually, I'm lying--it is possible to do an
-implicit loop with either the B<-n> or B<-p> switch. It's just not the
-mandatory default like it is in B<sed> and B<awk>.)
-
-=head2 Declarations
+The sequence of statements is executed just once, unlike in B<sed>
+and B<awk> scripts, where the sequence of statements is executed
+for each input line. While this means that you must explicitly
+loop over the lines of your input file (or files), it also means
+you have much more control over which files and which lines you look at.
+(Actually, I'm lying--it is possible to do an implicit loop with
+either the B<-n> or B<-p> switch. It's just not the mandatory
+default like it is in B<sed> and B<awk>.)
Perl is, for the most part, a free-form language. (The only exception
to this is format declarations, for obvious reasons.) Text from a
@@ -29,11 +22,27 @@ interpreted either as division or pattern matching, depending on the
context, and C++ C<//> comments just look like a null regular
expression, so don't do that.
+=head2 Declarations
+
+The only things you need to declare in Perl are report formats
+and subroutines--and even undefined subroutines can be handled
+through AUTOLOAD. A variable holds the undefined value (C<undef>)
+until it has been assigned a defined value, which is anything
+other than C<undef>. When used as a number, C<undef> is treated
+as C<0>; when used as a string, it is treated the empty string,
+C<"">; and when used as a reference that isn't being assigned
+to, it is treated as an error. If you enable warnings, you'll
+be notified of an uninitialized value whenever you treat C<undef>
+as a string or a number. Well, usually. Boolean ("don't-care")
+contexts and operators such as C<++>, C<-->, C<+=>, C<-=>, and
+C<.=> are always exempt from such warnings.
+
A declaration can be put anywhere a statement can, but has no effect on
the execution of the primary sequence of statements--declarations all
take effect at compile time. Typically all the declarations are put at
the beginning or the end of the script. However, if you're using
-lexically-scoped private variables created with C<my()>, you'll have to make sure
+lexically-scoped private variables created with C<my()>, you'll
+have to make sure
your format or subroutine definition is within the same block scope
as the my if you expect to be able to access those private variables.