From: Michael Stevens Date: Thu, 15 Mar 2001 20:01:12 +0000 (+0000) Subject: the uncontroversial doc patches X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=cea6626fc5e04af2c1d079dd4d3784eb2c21174b;p=p5sagit%2Fp5-mst-13.2.git the uncontroversial doc patches Message-ID: <20010315200112.A7636@firedrake.org> p4raw-id: //depot/perl@9175 --- diff --git a/pod/perl5005delta.pod b/pod/perl5005delta.pod index 4b50f40..78bf90f 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 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 and L. 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 ece5848..e11102e 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', 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, it hasn't happened yet. So while we can print a variable with the letter 'B

', 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': - + 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), the 'B' 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': 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': 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 perlTK based wrapper for the built-in debugger B data display debugger - + B and B are NT specific NB. (more info on these and others would be appreciated). diff --git a/pod/perldelta.pod b/pod/perldelta.pod index fa4a67e..473686f 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 725b50e..db58265 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -2118,7 +2118,7 @@ integer overflow trigger a warning. There is no builtin C function. It is just an ordinary method (subroutine) defined (or inherited) by modules that wish to export names to another module. The C function calls the C method -for the package used. See also L, L, and L. +for the package used. See also L, L, and L. =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. +it succeeded, false otherwise. See the example in +L. =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 62c80e7..1959680 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!) or the given +either the named function (but see L!) 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 and not C - see L. +Notice we use C and not C - see L. 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 b98e333..951a470 100644 --- a/pod/perllexwarn.pod +++ b/pod/perllexwarn.pod @@ -325,16 +325,16 @@ and C 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 d37664c..f680c73 100644 --- a/pod/perllocale.pod +++ b/pod/perllocale.pod @@ -381,7 +381,7 @@ with a single parameter--see L.) localeconv() takes no arguments, and returns B a hash. The keys of this hash are variable names for formatting, such as C and C. The values are the -corresponding, er, values. See L for a longer +corresponding, er, values. See L 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, because localeconv() always observes the @@ -964,12 +964,12 @@ operating system upgrade. =head1 SEE ALSO -L, L, L, -L, L, L, -L, L, L, -L, L, L, -L, L, L, -L. +L, L, L, +L, L, L, +L, L, L, +L, L, L, +L, L, L, +L. =head1 HISTORY diff --git a/pod/perllol.pod b/pod/perllol.pod index f015a20..5c16bfd 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 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 6f98cf6..01056f1 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. +$_ is still global though. See also +L. Ced 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 d0bd1c9..62d249a 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 457584c..9f47138 100644 --- a/pod/perlport.pod +++ b/pod/perlport.pod @@ -720,10 +720,11 @@ as L), http://www.cygwin.com/ =item * The U/WIN environment for Win32, - +=item * +Build instructions for OS/2, L =back diff --git a/pod/perlrun.pod b/pod/perlrun.pod index aa2f06d..3170df4 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. +see L. 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 940c3c0..af5b4cc 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, Use L and L, Use -L, Use L - wisely!, Use L, Write tests, Write the README +L, Use L - wisely!, +Use L, Write tests, Write the README =item Step-by-step: Distributing your module diff --git a/pod/perlxs.pod b/pod/perlxs.pod index a4db596..541f75e 100644 --- a/pod/perlxs.pod +++ b/pod/perlxs.pod @@ -809,9 +809,9 @@ mixed with ANSI-style declarations, as in (here the optional C keyword is omitted). The C parameters are identical with parameters introduced with -L and put into the C section (see L). The C parameters are very similar, the -only difference being that the value C function writes through the +L and put into the C section (see +L). The C 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 5b7ed6d..f06e166 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);