diff options
Diffstat (limited to 'pod')
-rw-r--r-- | pod/buildtoc.PL | 2 | ||||
-rw-r--r-- | pod/perl.pod | 1 | ||||
-rw-r--r-- | pod/perlebcdic.pod | 13 | ||||
-rw-r--r-- | pod/perlfaq7.pod | 4 | ||||
-rw-r--r-- | pod/perlguts.pod | 33 | ||||
-rw-r--r-- | pod/perlmod.pod | 4 | ||||
-rw-r--r-- | pod/perlop.pod | 2 | ||||
-rw-r--r-- | pod/perlport.pod | 5 | ||||
-rw-r--r-- | pod/pod2man.PL | 16 |
9 files changed, 69 insertions, 11 deletions
diff --git a/pod/buildtoc.PL b/pod/buildtoc.PL index 55e39252d9..3819308031 100644 --- a/pod/buildtoc.PL +++ b/pod/buildtoc.PL @@ -150,6 +150,7 @@ if (-d "pod") { perl5005delta perl5004delta + perlaix perlamiga perlcygwin perldos @@ -163,6 +164,7 @@ if (-d "pod") { ); @ARCHPODS = qw( + perlaix perlamiga perlcygwin perldos diff --git a/pod/perl.pod b/pod/perl.pod index fc40d3b33a..946d6f2927 100644 --- a/pod/perl.pod +++ b/pod/perl.pod @@ -104,6 +104,7 @@ For ease of access, the Perl manual has been split up into several sections: perl5005delta Perl changes in version 5.005 perl5004delta Perl changes in version 5.004 + perlaix Perl notes for AIX perlamiga Perl notes for Amiga perlcygwin Perl notes for Cygwin perldos Perl notes for DOS diff --git a/pod/perlebcdic.pod b/pod/perlebcdic.pod index 4ef5eca2d0..12ea2f3ef4 100644 --- a/pod/perlebcdic.pod +++ b/pod/perlebcdic.pod @@ -501,7 +501,8 @@ provide easy to use ASCII to EBCDIC operations that are also easily reversed. For example, to convert ASCII to code page 037 take the output of the second -column from the output of recipe 0 and use it in tr/// like so: +column from the output of recipe 0 (modified to add \\ characters) and use +it in tr/// like so: $cp_037 = '\000\001\002\003\234\011\206\177\227\215\216\013\014\015\016\017' . @@ -524,15 +525,19 @@ column from the output of recipe 0 and use it in tr/// like so: my $ebcdic_string = $ascii_string; eval '$ebcdic_string =~ tr/\000-\377/' . $cp_037 . '/'; -To convert from EBCDIC to ASCII just reverse the order of the tr/// +To convert from EBCDIC 037 to ASCII just reverse the order of the tr/// arguments like so: my $ascii_string = $ebcdic_string; - eval '$ascii_string = tr/' . $code_page_chrs . '/\000-\037/'; + eval '$ascii_string = tr/' . $cp_037 . '/\000-\377/'; + +Similarly one could take the output of the third column from recipe 0 to +obtain a C<$cp_1047> table. The fourth column of the output from recipe +0 could provide a C<$cp_posix_bc> table suitable for transcoding as well. =head2 iconv -XPG4 operability often implies the presence of an I<iconv> utility +XPG operability often implies the presence of an I<iconv> utility available from the shell or from the C library. Consult your system's documentation for information on iconv. diff --git a/pod/perlfaq7.pod b/pod/perlfaq7.pod index 1ca7893f13..0d4876fd68 100644 --- a/pod/perlfaq7.pod +++ b/pod/perlfaq7.pod @@ -196,6 +196,10 @@ own module. Make sure to change the names appropriately. } our @EXPORT_OK; + # exported package globals go here + our $Var1; + our %Hashit; + # non-exported package globals go here our @more; our $stuff; diff --git a/pod/perlguts.pod b/pod/perlguts.pod index da67c89d39..f525a070a5 100644 --- a/pod/perlguts.pod +++ b/pod/perlguts.pod @@ -210,6 +210,39 @@ line and all will be well. To free an SV that you've created, call C<SvREFCNT_dec(SV*)>. Normally this call is not necessary (see L<Reference Counts and Mortality>). +=head2 Offsets + +Perl provides the function C<sv_chop> to efficiently remove characters +from the beginning of a string; you give it an SV and a pointer to +somewhere inside the the PV, and it discards everything before the +pointer. The efficiency comes by means of a little hack: instead of +actually removing the characters, C<sv_chop> sets the flag C<OOK> +(offset OK) to signal to other functions that the offset hack is in +effect, and it puts the number of bytes chopped off into the IV field +of the SV. It then moves the PV pointer (called C<SvPVX>) forward that +many bytes, and adjusts C<SvCUR> and C<SvLEN>. + +Hence, at this point, the start of the buffer that we allocated lives +at C<SvPVX(sv) - SvIV(sv)> in memory and the PV pointer is pointing +into the middle of this allocated storage. + +This is best demonstrated by example: + + % ./perl -Ilib -MDevel::Peek -le '$a="12345"; $a=~s/.//; Dump($a)' + SV = PVIV(0x8128450) at 0x81340f0 + REFCNT = 1 + FLAGS = (POK,OOK,pPOK) + IV = 1 (OFFSET) + PV = 0x8135781 ( "1" . ) "2345"\0 + CUR = 4 + LEN = 5 + +Here the number of bytes chopped off (1) is put into IV, and +C<Devel::Peek::Dump> helpfully reminds us that this is an offset. The +portion of the string between the "real" and the "fake" beginnings is +shown in parentheses, and the values of C<SvCUR> and C<SvLEN> reflect +the fake beginning, not the real one. + =head2 What's Really Stored in an SV? Recall that the usual method of determining the type of scalar you have is diff --git a/pod/perlmod.pod b/pod/perlmod.pod index a9a87562a8..6f98cf6d99 100644 --- a/pod/perlmod.pod +++ b/pod/perlmod.pod @@ -310,6 +310,10 @@ create a file called F<Some/Module.pm> and start with this template: } our @EXPORT_OK; + # exported package globals go here + our $Var1; + our %Hashit; + # non-exported package globals go here our @more; our $stuff; diff --git a/pod/perlop.pod b/pod/perlop.pod index 32eaa3c330..e97a25bc9b 100644 --- a/pod/perlop.pod +++ b/pod/perlop.pod @@ -710,7 +710,7 @@ on a Mac, these are reversed, and on systems without line terminator, printing C<"\n"> may emit no actual data. In general, use C<"\n"> when you mean a "newline" for your system, but use the literal ASCII when you need an exact character. For example, most networking protocols expect -and prefer a CR+LF (C<"\012\015"> or C<"\cJ\cM">) for line terminators, +and prefer a CR+LF (C<"\015\012"> or C<"\cM\cJ">) for line terminators, and although they often accept just C<"\012">, they seldom tolerate just C<"\015">. If you get in the habit of using C<"\n"> for networking, you may be burned some day. diff --git a/pod/perlport.pod b/pod/perlport.pod index 25e1371808..0c3554686d 100644 --- a/pod/perlport.pod +++ b/pod/perlport.pod @@ -1995,8 +1995,9 @@ http://www.perl.com/CPAN/ports/index.html for binary distributions. =head1 SEE ALSO -L<perlamiga>, L<perlcygwin>, L<perldos>, L<perlhpux>, L<perlos2>, -L<perlos390>, L<perlwin32>, L<perlvms>, and L<Win32>. +L<perlaix>, L<perlamiga>, L<perlcygwin>, L<perldos>, L<perlebcdic>, +L<perlhpux>, L<perlos2>, L<perlos390>, L<perlposix-bc>, L<perlwin32>, +L<perlvms>, and L<Win32>. =head1 AUTHORS / CONTRIBUTORS diff --git a/pod/pod2man.PL b/pod/pod2man.PL index 4c5831b90b..dd5bb634be 100644 --- a/pod/pod2man.PL +++ b/pod/pod2man.PL @@ -72,9 +72,14 @@ if ($options{official} && !defined $options{center}) { $options{center} = 'Perl Programmers Reference Guide'; } -# Initialize and run the formatter. +# Initialize and run the formatter, pulling a pair of input and output off +# at a time. my $parser = Pod::Man->new (%options); -$parser->parse_from_file (@ARGV); +my @files; +do { + @files = splice (@ARGV, 0, 2); + $parser->parse_from_file (@files); +} while (@ARGV); __END__ @@ -88,7 +93,7 @@ pod2man [B<--section>=I<manext>] [B<--release>=I<version>] [B<--center>=I<string>] [B<--date>=I<string>] [B<--fixed>=I<font>] [B<--fixedbold>=I<font>] [B<--fixeditalic>=I<font>] [B<--fixedbolditalic>=I<font>] [B<--official>] [B<--lax>] -[B<--quotes>=I<quotes>] [I<input> [I<output>]] +[B<--quotes>=I<quotes>] [I<input> [I<output>] ...] pod2man B<--help> @@ -101,7 +106,10 @@ terminal using nroff(1), normally via man(1), or printing using troff(1). I<input> is the file to read for POD source (the POD can be embedded in code). If I<input> isn't given, it defaults to STDIN. I<output>, if given, is the file to which to write the formatted output. If I<output> isn't -given, the formatted output is written to STDOUT. +given, the formatted output is written to STDOUT. Several POD files can be +processed in the same B<pod2man> invocation (saving module load and compile +times) by providing multiple pairs of I<input> and I<output> files on the +command line. B<--section>, B<--release>, B<--center>, B<--date>, and B<--official> can be used to set the headers and footers to use; if not given, Pod::Man will |