summaryrefslogtreecommitdiff
path: root/perl.man.4
diff options
context:
space:
mode:
authorLarry Wall <lwall@jpl-devvax.jpl.nasa.gov>1989-11-17 03:02:59 +0000
committerLarry Wall <lwall@jpl-devvax.jpl.nasa.gov>1989-11-17 03:02:59 +0000
commitffed7fefd1d95d05e699dababfbb57ef2497cea1 (patch)
treeac02e16ead3b52915c921545a9ccb80f5c857501 /perl.man.4
parent0d3e774cdb279a1eadd8282d49334b9b1bfd42ed (diff)
downloadperl-ffed7fefd1d95d05e699dababfbb57ef2497cea1.tar.gz
perl 3.0 patch #6 patch 5 continued
See patch 5.
Diffstat (limited to 'perl.man.4')
-rw-r--r--perl.man.444
1 files changed, 26 insertions, 18 deletions
diff --git a/perl.man.4 b/perl.man.4
index 5d3b8c91bd..5f768aa9e8 100644
--- a/perl.man.4
+++ b/perl.man.4
@@ -1,7 +1,11 @@
''' Beginning of part 4
-''' $Header: perl.man.4,v 3.0.1.2 89/11/11 04:46:40 lwall Locked $
+''' $Header: perl.man.4,v 3.0.1.3 89/11/17 15:32:25 lwall Locked $
'''
''' $Log: perl.man.4,v $
+''' Revision 3.0.1.3 89/11/17 15:32:25 lwall
+''' patch5: fixed some manual typos and indent problems
+''' patch5: clarified difference between $! and $@
+'''
''' Revision 3.0.1.2 89/11/11 04:46:40 lwall
''' patch2: made some line breaks depend on troff vs. nroff
''' patch2: clarified operation of ^ and $ when $* is false
@@ -49,22 +53,22 @@ be of highest precedence, just like a normal function call.
Examples:
.nf
- chdir $foo || die; # (chdir $foo) || die
- chdir($foo) || die; # (chdir $foo) || die
- chdir ($foo) || die; # (chdir $foo) || die
- chdir +($foo) || die; # (chdir $foo) || die
+ chdir $foo || die;\h'|3i'# (chdir $foo) || die
+ chdir($foo) || die;\h'|3i'# (chdir $foo) || die
+ chdir ($foo) || die;\h'|3i'# (chdir $foo) || die
+ chdir +($foo) || die;\h'|3i'# (chdir $foo) || die
but, because * is higher precedence than ||:
- chdir $foo * 20; # chdir ($foo * 20)
- chdir($foo) * 20; # (chdir $foo) * 20
- chdir ($foo) * 20; # (chdir $foo) * 20
- chdir +($foo) * 20; # chdir ($foo * 20)
+ chdir $foo * 20;\h'|3i'# chdir ($foo * 20)
+ chdir($foo) * 20;\h'|3i'# (chdir $foo) * 20
+ chdir ($foo) * 20;\h'|3i'# (chdir $foo) * 20
+ chdir +($foo) * 20;\h'|3i'# chdir ($foo * 20)
- rand 10 * 20; # rand (10 * 20)
- rand(10) * 20; # (rand 10) * 20
- rand (10) * 20; # (rand 10) * 20
- rand +(10) * 20; # rand (10 * 20)
+ rand 10 * 20;\h'|3i'# rand (10 * 20)
+ rand(10) * 20;\h'|3i'# (rand 10) * 20
+ rand (10) * 20;\h'|3i'# (rand 10) * 20
+ rand +(10) * 20;\h'|3i'# rand (10 * 20)
.fi
In the absence of parentheses,
@@ -801,14 +805,18 @@ important.)
.Ip $! 8 2
If used in a numeric context, yields the current value of errno, with all the
usual caveats.
+(This means that you shouldn't depend on the value of $! to be anything
+in particular unless you've gotten a specific error return indicating a
+system error.)
If used in a string context, yields the corresponding system error string.
You can assign to $! in order to set errno
if, for instance, you want $! to return the string for error n, or you want
to set the exit value for the die operator.
(Mnemonic: What just went bang?)
.Ip $@ 8 2
-The error message from the last eval command.
-If null, the last eval parsed and executed correctly.
+The perl syntax error message from the last eval command.
+If null, the last eval parsed and executed correctly (although the operations
+you invoked may have failed in the normal fashion).
(Mnemonic: Where was the syntax error \*(L"at\*(R"?)
.Ip $< 8 2
The real uid of this process.
@@ -1041,14 +1049,14 @@ Just outdent it a little to make it more visible:
Don't be afraid to use loop labels\*(--they're there to enhance readability as
well as to allow multi-level loop breaks.
See last example.
-.Ip 6. 4 4
+.Ip 4. 4 4
For portability, when using features that may not be implemented on every
machine, test the construct in an eval to see if it fails.
If you know what version or patchlevel a particular feature was implemented,
you can test $] to see if it will be there.
-.Ip 4. 4 4
-Choose mnemonic identifiers.
.Ip 5. 4 4
+Choose mnemonic identifiers.
+.Ip 6. 4 4
Be consistent.
.Sh "Debugging"
If you invoke