summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stevens <mstevens@etla.org>2001-03-15 20:01:12 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-03-16 02:53:32 +0000
commitcea6626fc5e04af2c1d079dd4d3784eb2c21174b (patch)
tree90eadfaeaab2755554409cb8b6cc868e4054fcef
parent8722d079bea855032e83d28746a234953bd00d85 (diff)
downloadperl-cea6626fc5e04af2c1d079dd4d3784eb2c21174b.tar.gz
the uncontroversial doc patches
Message-ID: <20010315200112.A7636@firedrake.org> p4raw-id: //depot/perl@9175
-rw-r--r--pod/perl5005delta.pod6
-rw-r--r--pod/perldebtut.pod78
-rw-r--r--pod/perldelta.pod2
-rw-r--r--pod/perlfunc.pod7
-rw-r--r--pod/perlhack.pod4
-rw-r--r--pod/perllexwarn.pod8
-rw-r--r--pod/perllocale.pod14
-rw-r--r--pod/perllol.pod8
-rw-r--r--pod/perlmod.pod4
-rw-r--r--pod/perlmodlib.pod4
-rw-r--r--pod/perlport.pod5
-rw-r--r--pod/perlrun.pod3
-rw-r--r--pod/perltoc.pod4
-rw-r--r--pod/perlxs.pod6
-rw-r--r--pod/perlxstut.pod8
15 files changed, 80 insertions, 81 deletions
diff --git a/pod/perl5005delta.pod b/pod/perl5005delta.pod
index 4b50f402c4..78bf90f616 100644
--- a/pod/perl5005delta.pod
+++ b/pod/perl5005delta.pod
@@ -609,6 +609,8 @@ Various pragmata to control behavior of regular expressions.
You can now run tests for I<x> seconds instead of guessing the right
number of tests to run.
+Keeps better time.
+
=item Carp
Carp has a new function cluck(). cluck() warns, like carp(), but also adds
@@ -666,10 +668,6 @@ See <perlmodinstall> and L<CPAN>.
Cwd::cwd is faster on most platforms.
-=item Benchmark
-
-Keeps better time.
-
=back
=head1 Utility Changes
diff --git a/pod/perldebtut.pod b/pod/perldebtut.pod
index ece5848269..e11102e567 100644
--- a/pod/perldebtut.pod
+++ b/pod/perldebtut.pod
@@ -21,10 +21,10 @@ straightforward when it comes to debugging perl programs, without using the
debugger at all. To demonstrate, here's a simple script with a problem:
#!/usr/bin/perl
-
+
$var1 = 'Hello World'; # always wanted to do that :-)
$var2 = "$varl\n";
-
+
print $var2;
exit;
@@ -45,7 +45,7 @@ first line of the script.
Now when you run it, perl complains about the 3 undeclared variables and we
get four error messages because one variable is referenced twice:
-
+
Global symbol "$var1" requires explicit package name at ./t1 line 4.
Global symbol "$var2" requires explicit package name at ./t1 line 5.
Global symbol "$varl" requires explicit package name at ./t1 line 5.
@@ -57,11 +57,11 @@ script looks like this:
#!/usr/bin/perl
use strict;
-
+
my $var1 = 'Hello World';
my $varl = '';
my $var2 = "$varl\n";
-
+
print $var2;
exit;
@@ -97,7 +97,7 @@ dynamic variable, just before using it?
Looks OK, after it's been through the syntax check (perl -c scriptname), we
run it and all we get is a blank line again! Hmmmm.
-
+
One common debugging approach here, would be to liberally sprinkle a few print
statements, to add a check just before we print out our data, and another just
after:
@@ -107,10 +107,10 @@ after:
print "done: '$data{$key}'\n";
And try again:
-
+
> perl data
All OK
-
+
done: ''
After much staring at the same piece of code and not seeing the wood for the
@@ -137,7 +137,7 @@ just the letter 'B<q>', not the words 'quit' or 'exit':
DB<1> q
>
-
+
That's it, you're back on home turf again.
@@ -174,7 +174,7 @@ break/watch/actions
V [Pk [Vars]] List Variables in Package. Vars can be ~pattern or !pattern.
X [Vars] Same as "V current_package [Vars]".
For more help, type h cmd_letter, or run man perldebug for all docs.
-
+
More confusing options than you can shake a big stick at! It's not as bad as
it looks and it's very useful to know more about all of it, and fun too!
@@ -196,7 +196,7 @@ the 'name':
DM<3>X ~err
FileHandle(stderr) => fileno(2)
-
+
Remember we're in our tiny program with a problem, we should have a look at
where we are, and what our data looks like. First of all let's have a window
on our present position (the first line of code in this case), via the letter
@@ -216,7 +216,7 @@ on our present position (the first line of code in this case), via the letter
At line number 4 is a helpful pointer, that tells you where you are now. To
see more code, type 'w' again:
-
+
DB<4> w
8 'welcome' => q(Hello World),
9 'zip' => q(welcome),
@@ -231,19 +231,19 @@ And if you wanted to list line 5 again, type 'l 5', (note the space):
DB<4> l 5
5: my %data = (
-
+
In this case, there's not much to see, but of course normally there's pages of
stuff to wade through, and 'l' can be very useful. To reset your view to the
line we're about to execute, type a lone period '.':
DB<5> .
main::(./data_a:4): my $key = 'welcome';
-
+
The line shown is the one that is about to be executed B<next>, it hasn't
happened yet. So while we can print a variable with the letter 'B<p>', at
this point all we'd get is an empty (undefined) value back. What we need to
do is to step through the next executable statement with an 'B<s>':
-
+
DB<6> s
main::(./data_a:5): my %data = (
main::(./data_a:6): 'this' => qw(that),
@@ -264,21 +264,21 @@ line or sub routine:
DB<8> c 13
All OK
main::(./data_a:13): print "$data{$key}\n";
-
+
We've gone past our check (where 'All OK' was printed) and have stopped just
before the meat of our task. We could try to print out a couple of variables
to see what is happening:
DB<9> p $data{$key}
-
+
Not much in there, lets have a look at our hash:
-
+
DB<10> p %data
Hello Worldziptomandwelcomejerrywelcomethisthat
DB<11> p keys %data
Hello Worldtomwelcomejerrythis
-
+
Well, this isn't very easy to read, and using the helpful manual (B<h h>), the
'B<x>' command looks promising:
@@ -349,7 +349,7 @@ Now build an on-the-fly object over a couple of lines (note the backslash):
cont: {'col' => 'black', 'things' => [qw(this that etc)]}}, 'MY_class')
And let's have a look at it:
-
+
DB<2> x $obj
0 MY_class=HASH(0x828ad98)
'attr' => HASH(0x828ad68)
@@ -365,7 +365,7 @@ Useful, huh? You can eval nearly anything in there, and experiment with bits
of code or regexes until the cows come home:
DB<3> @data = qw(this that the other atheism leather theory scythe)
-
+
DB<4> p 'saw -> '.($cnt += map { print "\t:\t$_\n" } grep(/the/, sort @data))
atheism
leather
@@ -384,7 +384,7 @@ If you want to see the command History, type an 'B<H>':
1: $obj = bless({'unique_id'=>'123', 'attr'=>
{'col' => 'black', 'things' => [qw(this that etc)]}}, 'MY_class')
DB<5>
-
+
And if you want to repeat any previous command, use the exclamation: 'B<!>':
DB<5> !4
@@ -446,22 +446,22 @@ expected output. This is what it does:
> temp -c0.72
33.30 f
-
+
> temp -f33.3
162.94 c
-
+
Not very consistent! We'll set a breakpoint in the code manually and run it
under the debugger to see what's going on. A breakpoint is a flag, to which
the debugger will run without interruption, when it reaches the breakpoint, it
will stop execution and offer a prompt for further interaction. In normal
use, these debugger commands are completely ignored, and they are safe - if a
little messy, to leave in production code.
-
+
my ($in, $out) = ($num, $num);
$DB::single=2; # insert at line 9!
if ($deg eq 'c')
...
-
+
> perl -d temp -f33.3
Default die handler restored.
@@ -478,7 +478,7 @@ We'll simply continue down to our pre-set breakpoint with a 'B<c>':
main::(temp:10): if ($deg eq 'c') {
Followed by a window command to see where we are:
-
+
DB<1> w
7: my ($deg, $num) = ($1, $2);
8: my ($in, $out) = ($num, $num);
@@ -499,9 +499,9 @@ And a print to show what values we're currently using:
We can put another break point on any line beginning with a colon, we'll use
line 17 as that's just as we come out of the subroutine, and we'd like to
pause there later on:
-
+
DB<2> b 17
-
+
There's no feedback from this, but you can see what breakpoints are set by
using the list 'L' command:
@@ -550,13 +550,13 @@ possibilities with our sum:
DB<6> p (5 * $f - 32 / 9)
162.944444444444
-
+
DB<7> p 5 * $f - (32 / 9)
162.944444444444
-
+
DB<8> p (5 * $f) - 32 / 9
162.944444444444
-
+
DB<9> p 5 * ($f - 32) / 9
0.722222222222221
@@ -564,10 +564,10 @@ possibilities with our sum:
return out of the sub with an 'r':
DB<10> $c = 5 * ($f - 32) / 9
-
+
DB<11> r
scalar context return from main::f2c: 0.722222222222221
-
+
Looks good, let's just continue off the end of the script:
DB<12> c
@@ -585,11 +585,11 @@ actual program and we're finished.
Actions, watch variables, stack traces etc.: on the TODO list.
a
-
+
W
-
+
t
-
+
T
@@ -597,7 +597,7 @@ Actions, watch variables, stack traces etc.: on the TODO list.
Ever wanted to know what a regex looked like? You'll need perl compiled with
the DEBUGGING flag for this one:
-
+
> perl -Dr -e '/^pe(a)*rl$/i'
Compiling REx `^pe(a)*rl$'
size 17 first at 2
@@ -674,7 +674,7 @@ In particular have a hunt around for the following:
B<ptkdb> perlTK based wrapper for the built-in debugger
B<ddd> data display debugger
-
+
B<PerlDevKit> and B<PerlBuilder> are NT specific
NB. (more info on these and others would be appreciated).
diff --git a/pod/perldelta.pod b/pod/perldelta.pod
index fa4a67e939..473686f21e 100644
--- a/pod/perldelta.pod
+++ b/pod/perldelta.pod
@@ -891,7 +891,7 @@ emit the following message for lib/thr5005
# is still an experimental feature. It is here to stop people
# from deploying threads in production. ;-)
#
-
+
and another known thread-related warning is
pragma/overload......Unbalanced saves: 3 more saves than restores
diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod
index 725b50ecd1..db582653b4 100644
--- a/pod/perlfunc.pod
+++ b/pod/perlfunc.pod
@@ -2118,7 +2118,7 @@ integer overflow trigger a warning.
There is no builtin C<import> function. It is just an ordinary
method (subroutine) defined (or inherited) by modules that wish to export
names to another module. The C<use> function calls the C<import> method
-for the package used. See also L</use()>, L<perlmod>, and L<Exporter>.
+for the package used. See also L</use>, L<perlmod>, and L<Exporter>.
=item index STR,SUBSTR,POSITION
@@ -2337,7 +2337,8 @@ success, false otherwise.
=item listen SOCKET,QUEUESIZE
Does the same thing that the listen system call does. Returns true if
-it succeeded, false otherwise. See the example in L<perlipc/"Sockets: Client/Server Communication">.
+it succeeded, false otherwise. See the example in
+L<perlipc/"Sockets: Client/Server Communication">.
=item local EXPR
@@ -2491,7 +2492,7 @@ such as using a unary C<+> to give perl some help:
%hash = map { ("\L$_", 1) } @array # this also works
%hash = map { lc($_), 1 } @array # as does this.
%hash = map +( lc($_), 1 ), @array # this is EXPR and works!
-
+
%hash = map ( lc($_), 1 ), @array # evaluates to (1, @array)
or to force an anon hash constructor use C<+{>
diff --git a/pod/perlhack.pod b/pod/perlhack.pod
index 62c80e701f..1959680c13 100644
--- a/pod/perlhack.pod
+++ b/pod/perlhack.pod
@@ -1241,7 +1241,7 @@ Run the program with the given arguments.
=item break source.c:xxx
Tells the debugger that we'll want to pause execution when we reach
-either the named function (but see L</Function names>!) or the given
+either the named function (but see L<perlguts/Internal Functions>!) or the given
line in the named source file.
=item step
@@ -1299,7 +1299,7 @@ C<+> operator:
(gdb) break Perl_pp_add
Breakpoint 1 at 0x46249f: file pp_hot.c, line 309.
-Notice we use C<Perl_pp_add> and not C<pp_add> - see L<perlguts/Function Names>.
+Notice we use C<Perl_pp_add> and not C<pp_add> - see L<perlguts/Internal Functions>.
With the breakpoint in place, we can run our program:
(gdb) run -e '$b = "6XXXX"; $c = 2.3; $a = $b + $c'
diff --git a/pod/perllexwarn.pod b/pod/perllexwarn.pod
index b98e3332e4..951a470b2e 100644
--- a/pod/perllexwarn.pod
+++ b/pod/perllexwarn.pod
@@ -325,16 +325,16 @@ and C<join> can all produce a C<"Useless use of xxx in void context">
warning.
use warnings ;
-
+
time ;
-
+
{
use warnings FATAL => qw(void) ;
length "abc" ;
}
-
+
join "", 1,2,3 ;
-
+
print "done\n" ;
When run it produces this output
diff --git a/pod/perllocale.pod b/pod/perllocale.pod
index d37664c5ab..f680c73109 100644
--- a/pod/perllocale.pod
+++ b/pod/perllocale.pod
@@ -381,7 +381,7 @@ with a single parameter--see L<The setlocale function>.)
localeconv() takes no arguments, and returns B<a reference to> a hash.
The keys of this hash are variable names for formatting, such as
C<decimal_point> and C<thousands_sep>. The values are the
-corresponding, er, values. See L<POSIX (3)/localeconv> for a longer
+corresponding, er, values. See L<POSIX/localeconv> for a longer
example listing the categories an implementation might be expected to
provide; some provide more and others fewer. You don't need an
explicit C<use locale>, because localeconv() always observes the
@@ -964,12 +964,12 @@ operating system upgrade.
=head1 SEE ALSO
-L<POSIX (3)/isalnum>, L<POSIX (3)/isalpha>, L<POSIX (3)/isdigit>,
-L<POSIX (3)/isgraph>, L<POSIX (3)/islower>, L<POSIX (3)/isprint>,
-L<POSIX (3)/ispunct>, L<POSIX (3)/isspace>, L<POSIX (3)/isupper>,
-L<POSIX (3)/isxdigit>, L<POSIX (3)/localeconv>, L<POSIX (3)/setlocale>,
-L<POSIX (3)/strcoll>, L<POSIX (3)/strftime>, L<POSIX (3)/strtod>,
-L<POSIX (3)/strxfrm>.
+L<POSIX/isalnum>, L<POSIX/isalpha>, L<POSIX/isdigit>,
+L<POSIX/isgraph>, L<POSIX/islower>, L<POSIX/isprint>,
+L<POSIX/ispunct>, L<POSIX/isspace>, L<POSIX/isupper>,
+L<POSIX/isxdigit>, L<POSIX/localeconv>, L<POSIX/setlocale>,
+L<POSIX/strcoll>, L<POSIX/strftime>, L<POSIX/strtod>,
+L<POSIX/strxfrm>.
=head1 HISTORY
diff --git a/pod/perllol.pod b/pod/perllol.pod
index f015a20bc4..5c16bfddff 100644
--- a/pod/perllol.pod
+++ b/pod/perllol.pod
@@ -4,7 +4,7 @@ perllol - Manipulating Arrays of Arrays in Perl
=head1 DESCRIPTION
-=head1 Declaration and Access of Arrays of Arrays
+=head2 Declaration and Access of Arrays of Arrays
The simplest thing to build an array of arrays (sometimes imprecisely
called a list of lists). It's reasonably easy to understand, and
@@ -58,7 +58,7 @@ square or curly), you are free to omit the pointer dereferencing arrow.
But you cannot do so for the very first one if it's a scalar containing
a reference, which means that $ref_to_AoA always needs it.
-=head1 Growing Your Own
+=head2 Growing Your Own
That's all well and good for declaration of a fixed data structure,
but what if you wanted to add new elements on the fly, or build
@@ -174,7 +174,7 @@ Notice that I I<couldn't> say just:
In fact, that wouldn't even compile. How come? Because the argument
to push() must be a real array, not just a reference to such.
-=head1 Access and Printing
+=head2 Access and Printing
Now it's time to print your data structure out. How
are you going to do that? Well, if you want only one
@@ -231,7 +231,7 @@ Hmm... that's still a bit ugly. How about this:
}
}
-=head1 Slices
+=head2 Slices
If you want to get at a slice (part of a row) in a multidimensional
array, you're going to have to do some fancy subscripting. That's
diff --git a/pod/perlmod.pod b/pod/perlmod.pod
index 6f98cf6d99..01056f1d98 100644
--- a/pod/perlmod.pod
+++ b/pod/perlmod.pod
@@ -61,8 +61,8 @@ as a pattern match, a substitution, or a transliteration.
Variables beginning with underscore used to be forced into package
main, but we decided it was more useful for package writers to be able
to use leading underscore to indicate private variables and method names.
-$_ is still global though. See also L<perlvar/"Technical Note on the
-Syntax of Variable Names">.
+$_ is still global though. See also
+L<perlvar/"Technical Note on the Syntax of Variable Names">.
C<eval>ed strings are compiled in the package in which the eval() was
compiled. (Assignments to C<$SIG{}>, however, assume the signal
diff --git a/pod/perlmodlib.pod b/pod/perlmodlib.pod
index d0bd1c9b76..62d249a150 100644
--- a/pod/perlmodlib.pod
+++ b/pod/perlmodlib.pod
@@ -799,7 +799,7 @@ Most importantly, CPAN includes around a thousand unbundled modules,
some of which require a C compiler to build. Major categories of
modules are:
-=over
+=over 4
=item *
@@ -890,7 +890,7 @@ Miscellaneous Modules
Registered CPAN sites as of this writing include the following.
You should try to choose one close to you:
-=over
+=over 4
=item Africa
diff --git a/pod/perlport.pod b/pod/perlport.pod
index 457584c0cb..9f471388a6 100644
--- a/pod/perlport.pod
+++ b/pod/perlport.pod
@@ -720,10 +720,11 @@ as L<perlcygwin>), http://www.cygwin.com/
=item *
The U/WIN environment for Win32,
-<http://www.research.att.com/sw/tools/uwin/
+http://www.research.att.com/sw/tools/uwin/
-=item Build instructions for OS/2, L<perlos2>
+=item *
+Build instructions for OS/2, L<perlos2>
=back
diff --git a/pod/perlrun.pod b/pod/perlrun.pod
index aa2f06d0e2..3170df4ccc 100644
--- a/pod/perlrun.pod
+++ b/pod/perlrun.pod
@@ -451,8 +451,7 @@ specified in the extension then it will skip that file and continue on
with the next one (if it exists).
For a discussion of issues surrounding file permissions and B<-i>,
-see L<perlfaq5/Why does Perl let me delete read-only files? Why
-does -i clobber protected files? Isn't this a bug in Perl?>.
+see L<perlfaq5/Why does Perl let me delete read-only files? Why does -i clobber protected files? Isn't this a bug in Perl?>.
You cannot use B<-i> to create directories or to strip extensions from
files.
diff --git a/pod/perltoc.pod b/pod/perltoc.pod
index 940c3c0132..af5b4cc2ae 100644
--- a/pod/perltoc.pod
+++ b/pod/perltoc.pod
@@ -2303,8 +2303,8 @@ Look around, Check it's new, Discuss the need, Choose a name, Check again
=item Step-by-step: Making the module
Start with F<h2xs>, Use L<strict|strict> and L<warnings|warnings>, Use
-L<Carp|Carp>, Use L<Exporter|Exporter> - wisely!, Use L<plain old
-documentation|perlpod>, Write tests, Write the README
+L<Carp|Carp>, Use L<Exporter|Exporter> - wisely!,
+Use L<plain old documentation|perlpod>, Write tests, Write the README
=item Step-by-step: Distributing your module
diff --git a/pod/perlxs.pod b/pod/perlxs.pod
index a4db596755..541f75e535 100644
--- a/pod/perlxs.pod
+++ b/pod/perlxs.pod
@@ -809,9 +809,9 @@ mixed with ANSI-style declarations, as in
(here the optional C<IN> keyword is omitted).
The C<IN_OUT> parameters are identical with parameters introduced with
-L<The & Unary Operator> and put into the C<OUTPUT:> section (see L<The
-OUTPUT: Keyword>). The C<IN_OUTLIST> parameters are very similar, the
-only difference being that the value C function writes through the
+L<The & Unary Operator> and put into the C<OUTPUT:> section (see
+L<The OUTPUT: Keyword>). The C<IN_OUTLIST> parameters are very similar,
+the only difference being that the value C function writes through the
pointer would not modify the Perl parameter, but is put in the output
list.
diff --git a/pod/perlxstut.pod b/pod/perlxstut.pod
index 5b7ed6da34..f06e166326 100644
--- a/pod/perlxstut.pod
+++ b/pod/perlxstut.pod
@@ -1094,15 +1094,15 @@ Mytest.xs:
HV * rh;
STRLEN l;
char * fn = SvPV(*av_fetch((AV *)SvRV(paths), n, 0), l);
-
+
i = statfs(fn, &buf);
if (i != 0) {
av_push(results, newSVnv(errno));
continue;
}
-
+
rh = (HV *)sv_2mortal((SV *)newHV());
-
+
hv_store(rh, "f_bavail", 8, newSVnv(buf.f_bavail), 0);
hv_store(rh, "f_bfree", 7, newSVnv(buf.f_bfree), 0);
hv_store(rh, "f_blocks", 8, newSVnv(buf.f_blocks), 0);
@@ -1110,7 +1110,7 @@ Mytest.xs:
hv_store(rh, "f_ffree", 7, newSVnv(buf.f_ffree), 0);
hv_store(rh, "f_files", 7, newSVnv(buf.f_files), 0);
hv_store(rh, "f_type", 6, newSVnv(buf.f_type), 0);
-
+
av_push(results, newRV((SV *)rh));
}
RETVAL = newRV((SV *)results);