summaryrefslogtreecommitdiff
path: root/pod
diff options
context:
space:
mode:
Diffstat (limited to 'pod')
-rw-r--r--pod/checkpods.PL5
-rw-r--r--pod/perlbook.pod2
-rw-r--r--pod/perldata.pod2
-rw-r--r--pod/perldebug.pod2
-rw-r--r--pod/perldiag.pod14
-rw-r--r--pod/perlfaq8.pod334
-rw-r--r--pod/perlfaq9.pod4
-rw-r--r--pod/perlfunc.pod12
-rw-r--r--pod/perllol.pod2
-rw-r--r--pod/perlop.pod4
-rw-r--r--pod/perlsub.pod38
-rw-r--r--pod/perltoc.pod94
-rw-r--r--pod/perltoot.pod4
-rw-r--r--pod/pod2man.PL57
-rwxr-xr-xpod/splitpod10
15 files changed, 161 insertions, 423 deletions
diff --git a/pod/checkpods.PL b/pod/checkpods.PL
index 4bec4da609..ccd78ec9cf 100644
--- a/pod/checkpods.PL
+++ b/pod/checkpods.PL
@@ -62,7 +62,10 @@ while (<>) {
$exit = 1;
}
$last_blank = /^\s+$/;
- close(ARGV) if eof;
+ if (eof) {
+ close(ARGV);
+ $last_blank = 0;
+ }
}
exit $exit
!NO!SUBS!
diff --git a/pod/perlbook.pod b/pod/perlbook.pod
index d4bc876692..8005e81d29 100644
--- a/pod/perlbook.pod
+++ b/pod/perlbook.pod
@@ -33,3 +33,5 @@ of regular expressions in various languages including Perl.
Mastering Regular Expressions (the Hip Owl Book):
ISBN 1-56592-257-3 (English)
+
+A new edition of Learning Perl is due mid/late 1997.
diff --git a/pod/perldata.pod b/pod/perldata.pod
index 38d5e9380d..dc2975a7d4 100644
--- a/pod/perldata.pod
+++ b/pod/perldata.pod
@@ -196,7 +196,7 @@ You can truncate an array down to nothing by assigning the null list ()
to it. The following are equivalent:
@whatever = ();
- $#whatever = $[ - 1;
+ $#whatever = -1;
If you evaluate a named array in a scalar context, it returns the length of
the array. (Note that this is not true of lists, which return the
diff --git a/pod/perldebug.pod b/pod/perldebug.pod
index 94ece44a6f..1b206fb96d 100644
--- a/pod/perldebug.pod
+++ b/pod/perldebug.pod
@@ -334,7 +334,7 @@ affects printing of return value after C<r> command.
=item C<ornaments>
-affects screen appearance of the command line (see L<Term::Readline>).
+affects screen appearance of the command line (see L<Term::ReadLine>).
=item C<frame>
diff --git a/pod/perldiag.pod b/pod/perldiag.pod
index 9b37d0f7d0..1b0f92e31f 100644
--- a/pod/perldiag.pod
+++ b/pod/perldiag.pod
@@ -630,6 +630,10 @@ method, nor does any of its base classes. See L<perlobj>.
(W) The @ISA array contained the name of another package that doesn't seem
to exist.
+=item Can't make list assignment to \%ENV on this system
+
+(F) List assignment to %ENV is not supported on some systems, notably VMS.
+
=item Can't mktemp()
(F) The mktemp() routine failed for some reason while trying to process
@@ -893,7 +897,7 @@ a valid magic number.
=item Deep recursion on subroutine "%s"
(W) This subroutine has called itself (directly or indirectly) 100
-times than it has returned. This probably indicates an infinite
+times more than it has returned. This probably indicates an infinite
recursion, unless you're writing strange benchmark programs, in which
case it indicates something else.
@@ -2211,9 +2215,11 @@ construct. Remember that bracketing delimiters count nesting level.
=item substr outside of string
-(W) You tried to reference a substr() that pointed outside of a string.
-That is, the absolute value of the offset was larger than the length of
-the string. See L<perlfunc/substr>.
+(S),(W) You tried to reference a substr() that pointed outside of a
+string. That is, the absolute value of the offset was larger than the
+length of the string. See L<perlfunc/substr>. This warning is
+mandatory if substr is used in an lvalue context (as the left hand side
+of an assignment or as a subroutine argument for example).
=item suidperl is no longer needed since %s
diff --git a/pod/perlfaq8.pod b/pod/perlfaq8.pod
index 4fabce6f36..f4d3c12f6f 100644
--- a/pod/perlfaq8.pod
+++ b/pod/perlfaq8.pod
@@ -849,337 +849,3 @@ included with the 5.002 release of Perl.
Copyright (c) 1997 Tom Christiansen and Nathan Torkington.
All rights reserved. See L<perlfaq> for distribution information.
- END-of-perlfaq8.pod
-echo x - perlfaq9.pod
-sed 's/^X//' >perlfaq9.pod << 'END-of-perlfaq9.pod'
-=head1 NAME
-
-perlfaq9 - Networking ($Revision: 1.17 $, $Date: 1997/04/24 22:44:29 $)
-
-=head1 DESCRIPTION
-
-This section deals with questions related to networking, the internet,
-and a few on the web.
-
-=head2 My CGI script runs from the command line but not the browser. Can you help me fix it?
-
-Sure, but you probably can't afford our contracting rates :-)
-
-Seriously, if you can demonstrate that you've read the following FAQs
-and that your problem isn't something simple that can be easily
-answered, you'll probably receive a courteous and useful reply to your
-question if you post it on comp.infosystems.www.authoring.cgi (if it's
-something to do with HTTP, HTML, or the CGI protocols). Questions that
-appear to be Perl questions but are really CGI ones that are posted to
-comp.lang.perl.misc may not be so well received.
-
-The useful FAQs are:
-
- http://www.perl.com/perl/faq/idiots-guide.html
- http://www3.pair.com/webthing/docs/cgi/faqs/cgifaq.shtml
- http://www.perl.com/perl/faq/perl-cgi-faq.html
- http://www-genome.wi.mit.edu/WWW/faqs/www-security-faq.html
- http://www.boutell.com/faq/
-
-=head2 How do I remove HTML from a string?
-
-The most correct way (albeit not the fastest) is to use HTML::Parse
-from CPAN (part of the libwww-perl distribution, which is a must-have
-module for all web hackers).
-
-Many folks attempt a simple-minded regular expression approach, like
-C<s/E<lt>.*?E<gt>//g>, but that fails in many cases because the tags
-may continue over line breaks, they may contain quoted angle-brackets,
-or HTML comment may be present. Plus folks forget to convert
-entities, like C<&lt;> for example.
-
-Here's one "simple-minded" approach, that works for most files:
-
- #!/usr/bin/perl -p0777
- s/<(?:[^>'"]*|(['"]).*?\1)*>//gs
-
-If you want a more complete solution, see the 3-stage striphtml
-program in
-http://www.perl.com/CPAN/authors/Tom_Christiansen/scripts/striphtml.gz
-.
-
-=head2 How do I extract URLs?
-
-A quick but imperfect approach is
-
- #!/usr/bin/perl -n00
- # qxurl - tchrist@perl.com
- print "$2\n" while m{
- < \s*
- A \s+ HREF \s* = \s* (["']) (.*?) \1
- \s* >
- }gsix;
-
-This version does not adjust relative URLs, understand alternate
-bases, deal with HTML comments, deal with HREF and NAME attributes in
-the same tag, or accept URLs themselves as arguments. It also runs
-about 100x faster than a more "complete" solution using the LWP suite
-of modules, such as the
-http://www.perl.com/CPAN/authors/Tom_Christiansen/scripts/xurl.gz
-program.
-
-=head2 How do I download a file from the user's machine? How do I open a file on another machine?
-
-In the context of an HTML form, you can use what's known as
-B<multipart/form-data> encoding. The CGI.pm module (available from
-CPAN) supports this in the start_multipart_form() method, which isn't
-the same as the startform() method.
-
-=head2 How do I make a pop-up menu in HTML?
-
-Use the B<E<lt>SELECTE<gt>> and B<E<lt>OPTIONE<gt>> tags. The CGI.pm
-module (available from CPAN) supports this widget, as well as many
-others, including some that it cleverly synthesizes on its own.
-
-=head2 How do I fetch an HTML file?
-
-One approach, if you have the lynx text-based HTML browser installed
-on your system, is this:
-
- $html_code = `lynx -source $url`;
- $text_data = `lynx -dump $url`;
-
-The libwww-perl (LWP) modules from CPAN provide a more powerful way to
-do this. They work through proxies, and don't require lynx:
-
- # print HTML from a URL
- use LWP::Simple;
- getprint "http://www.sn.no/libwww-perl/";
-
- # print ASCII from HTML from a URL
- use LWP::Simple;
- use HTML::Parse;
- use HTML::FormatText;
- my ($html, $ascii);
- $html = get("http://www.perl.com/");
- defined $html
- or die "Can't fetch HTML from http://www.perl.com/";
- $ascii = HTML::FormatText->new->format(parse_html($html));
- print $ascii;
-
-=head2 how do I decode or create those %-encodings on the web?
-
-Here's an example of decoding:
-
- $string = "http://altavista.digital.com/cgi-bin/query?pg=q&what=news&fmt=.&q=%2Bcgi-bin+%2Bperl.exe";
- $string =~ s/%([a-fA-F0-9]{2})/chr(hex($1))/ge;
-
-Encoding is a bit harder, because you can't just blindly change
-all the non-alphanumunder character (C<\W>) into their hex escapes.
-It's important that characters with special meaning like C</> and C<?>
-I<not> be translated. Probably the easiest way to get this right is
-to avoid reinventing the wheel and just use the URI::Escape module,
-which is part of the libwww-perl package (LWP) available from CPAN.
-
-=head2 How do I redirect to another page?
-
-Instead of sending back a C<Content-Type> as the headers of your
-reply, send back a C<Location:> header. Officially this should be a
-C<URI:> header, so the CGI.pm module (available from CPAN) sends back
-both:
-
- Location: http://www.domain.com/newpage
- URI: http://www.domain.com/newpage
-
-Note that relative URLs in these headers can cause strange effects
-because of "optimizations" that servers do.
-
-=head2 How do I put a password on my web pages?
-
-That depends. You'll need to read the documentation for your web
-server, or perhaps check some of the other FAQs referenced above.
-
-=head2 How do I edit my .htpasswd and .htgroup files with Perl?
-
-The HTTPD::UserAdmin and HTTPD::GroupAdmin modules provide a
-consistent OO interface to these files, regardless of how they're
-stored. Databases may be text, dbm, Berkley DB or any database with a
-DBI compatible driver. HTTPD::UserAdmin supports files used by the
-`Basic' and `Digest' authentication schemes. Here's an example:
-
- use HTTPD::UserAdmin ();
- HTTPD::UserAdmin
- ->new(DB => "/foo/.htpasswd")
- ->add($username => $password);
-
-=head2 How do I make sure users can't enter values into a form that cause my CGI script to do bad things?
-
-Read the CGI security FAQ, at
-http://www-genome.wi.mit.edu/WWW/faqs/www-security-faq.html, and the
-Perl/CGI FAQ at
-http://www.perl.com/CPAN/doc/FAQs/cgi/perl-cgi-faq.html.
-
-In brief: use tainting (see L<perlsec>), which makes sure that data
-from outside your script (eg, CGI parameters) are never used in
-C<eval> or C<system> calls. In addition to tainting, never use the
-single-argument form of system() or exec(). Instead, supply the
-command and arguments as a list, which prevents shell globbing.
-
-=head2 How do I parse an email header?
-
-For a quick-and-dirty solution, try this solution derived
-from page 222 of the 2nd edition of "Programming Perl":
-
- $/ = '';
- $header = <MSG>;
- $header =~ s/\n\s+/ /g; # merge continuation lines
- %head = ( UNIX_FROM_LINE, split /^([-\w]+):\s*/m, $header );
-
-That solution doesn't do well if, for example, you're trying to
-maintain all the Received lines. A more complete approach is to use
-the Mail::Header module from CPAN (part of the MailTools package).
-
-=head2 How do I decode a CGI form?
-
-A lot of people are tempted to code this up themselves, so you've
-probably all seen a lot of code involving C<$ENV{CONTENT_LENGTH}> and
-C<$ENV{QUERY_STRING}>. It's true that this can work, but there are
-also a lot of versions of this floating around that are quite simply
-broken!
-
-Please do not be tempted to reinvent the wheel. Instead, use the
-CGI.pm or CGI_Lite.pm (available from CPAN), or if you're trapped in
-the module-free land of perl1 .. perl4, you might look into cgi-lib.pl
-(available from http://www.bio.cam.ac.uk/web/form.html).
-
-=head2 How do I check a valid email address?
-
-You can't.
-
-Without sending mail to the address and seeing whether it bounces (and
-even then you face the halting problem), you cannot determine whether
-an email address is valid. Even if you apply the email header
-standard, you can have problems, because there are deliverable
-addresses that aren't RFC-822 (the mail header standard) compliant,
-and addresses that aren't deliverable which are compliant.
-
-Many are tempted to try to eliminate many frequently-invalid email
-addresses with a simple regexp, such as
-C</^[\w.-]+\@([\w.-]\.)+\w+$/>. However, this also throws out many
-valid ones, and says nothing about potential deliverability, so is not
-suggested. Instead, see
-http://www.perl.com/CPAN/authors/Tom_Christiansen/scripts/ckaddr.gz ,
-which actually checks against the full RFC spec (except for nested
-comments), looks for addresses you may not wish to accept email to
-(say, Bill Clinton or your postmaster), and then makes sure that the
-hostname given can be looked up in DNS. It's not fast, but it works.
-
-Here's an alternative strategy used by many CGI script authors: Check
-the email address with a simple regexp (such as the one above). If
-the regexp matched the address, accept the address. If the regexp
-didn't match the address, request confirmation from the user that the
-email address they entered was correct.
-
-=head2 How do I decode a MIME/BASE64 string?
-
-The MIME-tools package (available from CPAN) handles this and a lot
-more. Decoding BASE64 becomes as simple as:
-
- use MIME::base64;
- $decoded = decode_base64($encoded);
-
-A more direct approach is to use the unpack() function's "u"
-format after minor transliterations:
-
- tr#A-Za-z0-9+/##cd; # remove non-base64 chars
- tr#A-Za-z0-9+/# -_#; # convert to uuencoded format
- $len = pack("c", 32 + 0.75*length); # compute length byte
- print unpack("u", $len . $_); # uudecode and print
-
-=head2 How do I return the user's email address?
-
-On systems that support getpwuid, the $E<lt> variable and the
-Sys::Hostname module (which is part of the standard perl distribution),
-you can probably try using something like this:
-
- use Sys::Hostname;
- $address = sprintf('%s@%s', getpwuid($<), hostname);
-
-Company policies on email address can mean that this generates addresses
-that the company's email system will not accept, so you should ask for
-users' email addresses when this matters. Furthermore, not all systems
-on which Perl runs are so forthcoming with this information as is Unix.
-
-The Mail::Util module from CPAN (part of the MailTools package) provides a
-mailaddress() function that tries to guess the mail address of the user.
-It makes a more intelligent guess than the code above, using information
-given when the module was installed, but it could still be incorrect.
-Again, the best way is often just to ask the user.
-
-=head2 How do I send/read mail?
-
-Sending mail: the Mail::Mailer module from CPAN (part of the MailTools
-package) is UNIX-centric, while Mail::Internet uses Net::SMTP which is
-not UNIX-centric. Reading mail: use the Mail::Folder module from CPAN
-(part of the MailFolder package) or the Mail::Internet module from
-CPAN (also part of the MailTools package).
-
- # sending mail
- use Mail::Internet;
- use Mail::Header;
- # say which mail host to use
- $ENV{SMTPHOSTS} = 'mail.frii.com';
- # create headers
- $header = new Mail::Header;
- $header->add('From', 'gnat@frii.com');
- $header->add('Subject', 'Testing');
- $header->add('To', 'gnat@frii.com');
- # create body
- $body = 'This is a test, ignore';
- # create mail object
- $mail = new Mail::Internet(undef, Header => $header, Body => \[$body]);
- # send it
- $mail->smtpsend or die;
-
-=head2 How do I find out my hostname/domainname/IP address?
-
-A lot of code has historically cavalierly called the C<`hostname`>
-program. While sometimes expedient, this isn't very portable. It's
-one of those tradeoffs of convenience versus portability.
-
-The Sys::Hostname module (part of the standard perl distribution) will
-give you the hostname after which you can find out the IP address
-(assuming you have working DNS) with a gethostbyname() call.
-
- use Socket;
- use Sys::Hostname;
- my $host = hostname();
- my $addr = inet_ntoa(scalar(gethostbyname($name)) || 'localhost');
-
-Probably the simplest way to learn your DNS domain name is to grok
-it out of /etc/resolv.conf, at least under Unix. Of course, this
-assumes several things about your resolv.conf configuration, including
-that it exists.
-
-(We still need a good DNS domain name-learning method for non-Unix
-systems.)
-
-=head2 How do I fetch a news article or the active newsgroups?
-
-Use the Net::NNTP or News::NNTPClient modules, both available from CPAN.
-This can make tasks like fetching the newsgroup list as simple as:
-
- perl -MNews::NNTPClient
- -e 'print News::NNTPClient->new->list("newsgroups")'
-
-=head2 How do I fetch/put an FTP file?
-
-LWP::Simple (available from CPAN) can fetch but not put. Net::FTP (also
-available from CPAN) is more complex but can put as well as fetch.
-
-=head2 How can I do RPC in Perl?
-
-A DCE::RPC module is being developed (but is not yet available), and
-will be released as part of the DCE-Perl package (available from
-CPAN). No ONC::RPC module is known.
-
-=head1 AUTHOR AND COPYRIGHT
-
-Copyright (c) 1997 Tom Christiansen and Nathan Torkington.
-All rights reserved. See L<perlfaq> for distribution information.
-
diff --git a/pod/perlfaq9.pod b/pod/perlfaq9.pod
index d7faca02e3..aa942c2da0 100644
--- a/pod/perlfaq9.pod
+++ b/pod/perlfaq9.pod
@@ -1,6 +1,6 @@
=head1 NAME
-perlfaq9 - Networking ($Revision: 1.16 $, $Date: 1997/04/23 18:12:06 $)
+perlfaq9 - Networking ($Revision: 1.17 $, $Date: 1997/04/24 22:44:29 $)
=head1 DESCRIPTION
@@ -295,7 +295,7 @@ give you the hostname after which you can find out the IP address
use Socket;
use Sys::Hostname;
my $host = hostname();
- my $addr = inet_ntoa(scalar(gethostbyname($host || 'localhost')));
+ my $addr = inet_ntoa(scalar(gethostbyname($name)) || 'localhost');
Probably the simplest way to learn your DNS domain name is to grok
it out of /etc/resolv.conf, at least under Unix. Of course, this
diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod
index e3c4c9546d..a28487ac1d 100644
--- a/pod/perlfunc.pod
+++ b/pod/perlfunc.pod
@@ -448,7 +448,7 @@ successfully changed. See also L</oct>, if all you have is a string.
=item chomp
-This is a slightly safer version of chop (see below). It removes any
+This is a slightly safer version of L</chop>. It removes any
line ending that corresponds to the current value of C<$/> (also known as
$INPUT_RECORD_SEPARATOR in the C<English> module). It returns the total
number of characters removed from all its arguments. It's often used to
@@ -1731,7 +1731,7 @@ it succeeded, FALSE otherwise. See example in L<perlipc/"Sockets: Client/Server
A local modifies the listed variables to be local to the enclosing block,
subroutine, C<eval{}>, or C<do>. If more than one value is listed, the
list must be placed in parentheses. See L<perlsub/"Temporary Values via
-local()"> for details.
+local()"> for details, including issues with tied arrays and hashes.
But you really probably want to be using my() instead, because local() isn't
what most people think of as "local"). See L<perlsub/"Private Variables
@@ -2335,10 +2335,10 @@ If EXPR is omitted, uses $_.
=item rand
-Returns a random fractional number between 0 and the value of EXPR.
-(EXPR should be positive.) If EXPR is omitted, returns a value between
-0 and 1. Automatically calls srand() unless srand() has already been
-called. See also srand().
+Returns a random fractional number greater than or equal to 0 and less
+than the value of EXPR. (EXPR should be positive.) If EXPR is
+omitted, the value 1 is used. Automatically calls srand() unless
+srand() has already been called. See also srand().
(Note: If your rand function consistently returns numbers that are too
large or too small, then your version of Perl was probably compiled
diff --git a/pod/perllol.pod b/pod/perllol.pod
index ac36364ae0..1de3b1ad74 100644
--- a/pod/perllol.pod
+++ b/pod/perllol.pod
@@ -270,7 +270,7 @@ $x run from 4..8 and $y run from 7 to 12? Hmm... here's the simple way:
@newLoL = ();
for ($startx = $x = 4; $x <= 8; $x++) {
- for ($starty = $y = 7; $x <= 12; $y++) {
+ for ($starty = $y = 7; $y <= 12; $y++) {
$newLoL[$x - $startx][$y - $starty] = $LoL[$x][$y];
}
}
diff --git a/pod/perlop.pod b/pod/perlop.pod
index d853865520..32a0827cb3 100644
--- a/pod/perlop.pod
+++ b/pod/perlop.pod
@@ -392,7 +392,7 @@ As a scalar operator:
As a list operator:
for (101 .. 200) { print; } # print $_ 100 times
- @foo = @foo[$[ .. $#foo]; # an expensive no-op
+ @foo = @foo[0 .. $#foo]; # an expensive no-op
@foo = @foo[$#foo-4 .. $#foo]; # slice last 5 items
The range operator (in a list context) makes use of the magical
@@ -1058,7 +1058,7 @@ of filenames. The loop
is equivalent to the following Perl-like pseudo code:
- unshift(@ARGV, '-') if $#ARGV < $[;
+ unshift(@ARGV, '-') unless @ARGV;
while ($ARGV = shift) {
open(ARGV, $ARGV);
while (<ARGV>) {
diff --git a/pod/perlsub.pod b/pod/perlsub.pod
index c124f21c6a..d08426adab 100644
--- a/pod/perlsub.pod
+++ b/pod/perlsub.pod
@@ -58,7 +58,7 @@ it was assigned to.) Note that assigning to the whole array @_ removes
the aliasing, and does not update any arguments.
The return value of the subroutine is the value of the last expression
-evaluated. Alternatively, a return statement may be used exit the
+evaluated. Alternatively, a return statement may be used to exit the
subroutine, optionally specifying the returned value, which will be
evaluated in the appropriate context (list, scalar, or void) depending
on the context of the subroutine call. If you specify no return value,
@@ -469,6 +469,42 @@ both supply a list context to the right-hand side, while
supplies a scalar context.
+A note about C<local()> and composite types is in order. Something
+like C<local(%foo)> works by temporarily placing a brand new hash in
+the symbol table. The old hash is left alone, but is hidden "behind"
+the new one.
+
+This means the old variable is completely invisible via the symbol
+table (i.e. the hash entry in the C<*foo> typeglob) for the duration
+of the dynamic scope within which the C<local()> was seen. This
+has the effect of allowing one to temporarily occlude any magic on
+composite types. For instance, this will briefly alter a tied
+hash to some other implementation:
+
+ tie %ahash, 'APackage';
+ [...]
+ {
+ local %ahash;
+ tie %ahash, 'BPackage';
+ [..called code will see %ahash tied to 'BPackage'..]
+ {
+ local %ahash;
+ [..%ahash is a normal (untied) hash here..]
+ }
+ }
+ [..%ahash back to its initial tied self again..]
+
+As another example, a custom implementation of C<%ENV> might look
+like this:
+
+ {
+ local %ENV;
+ tie %ENV, 'MyOwnEnv';
+ [..do your own fancy %ENV manipulation here..]
+ }
+ [..normal %ENV behavior here..]
+
+
=head2 Passing Symbol Table Entries (typeglobs)
[Note: The mechanism described in this section was originally the only
diff --git a/pod/perltoc.pod b/pod/perltoc.pod
index d58f12cf86..989c1efe01 100644
--- a/pod/perltoc.pod
+++ b/pod/perltoc.pod
@@ -775,60 +775,7 @@ search path?
=item AUTHOR AND COPYRIGHT
-=item DESCRIPTION
-
-=over
-
-=item My CGI script runs from the command line but not the browser. Can
-you help me fix it?
-
-=item How do I remove HTML from a string?
-
-=item How do I extract URLs?
-
-=item How do I download a file from the user's machine? How do I open a
-file on another machine?
-
-=item How do I make a pop-up menu in HTML?
-
-=item How do I fetch an HTML file?
-
-=item how do I decode or create those %-encodings on the web?
-
-=item How do I redirect to another page?
-
-=item How do I put a password on my web pages?
-
-=item How do I edit my .htpasswd and .htgroup files with Perl?
-
-=item How do I make sure users can't enter values into a form that cause my
-CGI script to do bad things?
-
-=item How do I parse an email header?
-
-=item How do I decode a CGI form?
-
-=item How do I check a valid email address?
-
-=item How do I decode a MIME/BASE64 string?
-
-=item How do I return the user's email address?
-
-=item How do I send/read mail?
-
-=item How do I find out my hostname/domainname/IP address?
-
-=item How do I fetch a news article or the active newsgroups?
-
-=item How do I fetch/put an FTP file?
-
-=item How can I do RPC in Perl?
-
-=back
-
-=item AUTHOR AND COPYRIGHT
-
-=head2 perlfaq9 - Networking ($Revision: 1.16 $, $Date: 1997/04/23 18:12:06
+=head2 perlfaq9 - Networking ($Revision: 1.17 $, $Date: 1997/04/24 22:44:29
$)
=item DESCRIPTION
@@ -894,6 +841,10 @@ CGI script to do bad things?
=over
+=item List assignment to %ENV works
+
+=item "Can't locate Foo.pm in @INC" error now lists @INC
+
=item Compilation option: Binary compatibility with 5.003
=item $PERL5OPT environment variable
@@ -904,6 +855,8 @@ CGI script to do bad things?
=item Deprecated: Inherited C<AUTOLOAD> for non-methods
+=item Previously deprecated %OVERLOAD is no longer usable
+
=item Subroutine arguments created only when they're modified
=item Group vector changeable with C<$)>
@@ -1241,8 +1194,8 @@ B<-T>, B<-u>, B<-U>, B<-v>, B<-V>, B<-V:>I<name>, B<-w>, B<-x> I<directory>
=item ENVIRONMENT
-HOME, LOGDIR, PATH, PERL5LIB, PERL5OPT, PERLLIB, PERL5DB,
-PERL_DEBUG_MSTATS, PERL_DESTRUCT_LEVEL
+HOME, LOGDIR, PATH, PERL5LIB, PERL5OPT, PERLLIB, PERL5DB, PERL5SHELL
+(specific to WIN32 port), PERL_DEBUG_MSTATS, PERL_DESTRUCT_LEVEL
=head2 perlfunc - Perl builtin functions
@@ -2194,6 +2147,8 @@ program
=back
+=item Embedding Perl under Win32
+
=item MORAL
=item AUTHOR
@@ -2408,6 +2363,8 @@ B<PerlIO_get_base(f)>, B<PerlIO_get_bufsiz(f)>
=item Finding Magic
+=item Understanding the Magic of Tied Hashes and Arrays
+
=back
=item Subroutines
@@ -3518,6 +3475,8 @@ For static extensions, For dynamic extensions, For dynamic extensions
=item VMS implementation
+=item Win32 implementation
+
=back
=item SEE ALSO
@@ -3609,9 +3568,10 @@ ExtUtils::MakeMaker
=item DESCRIPTION
-catfile, static_lib (o), dynamic_lib (o), canonpath, perl_script,
-pm_to_blib, test_via_harness (o), tool_autosplit (override), tools_other
-(o), manifypods (o), dist_ci (o), dist_core (o), pasthru (o)
+catfile, constants (o), static_lib (o), dynamic_bs (o), dynamic_lib (o),
+canonpath, perl_script, pm_to_blib, test_via_harness (o), tool_autosplit
+(override), tools_other (o), xs_o (o), top_targets (o), manifypods (o),
+dist_ci (o), dist_core (o), pasthru (o)
=head2 ExtUtils::MakeMaker - create an extension Makefile
@@ -3786,6 +3746,22 @@ rmscopy($from,$to[,$date_flag])
=item AUTHOR
+=head2 File::DosGlob - DOS like globbing and then some
+
+=item SYNOPSIS
+
+=item DESCRIPTION
+
+=item EXPORTS (by request only)
+
+=item BUGS
+
+=item AUTHOR
+
+=item HISTORY
+
+=item SEE ALSO
+
=head2 File::Find, find - traverse a file tree
=item SYNOPSIS
diff --git a/pod/perltoot.pod b/pod/perltoot.pod
index 2f5634c58c..3a35c05b90 100644
--- a/pod/perltoot.pod
+++ b/pod/perltoot.pod
@@ -89,7 +89,7 @@ the same name as the class as the constructor.
=head2 Object Representation
By far the most common mechanism used in Perl to represent a Pascal
-record, a C struct, or a C++ class an anonymous hash. That's because a
+record, a C struct, or a C++ class is an anonymous hash. That's because a
hash has an arbitrary number of data fields, each conveniently accessed by
an arbitrary name of your own devising.
@@ -799,7 +799,7 @@ base class. If the original base class has been designed properly,
then the new derived class can be used as a drop-in replacement for the
old one. This means you should be able to write a program like this:
- use Employee
+ use Employee;
my $empl = Employee->new();
$empl->name("Jason");
$empl->age(23);
diff --git a/pod/pod2man.PL b/pod/pod2man.PL
index fb30a67ab3..2c1837a37a 100644
--- a/pod/pod2man.PL
+++ b/pod/pod2man.PL
@@ -500,16 +500,36 @@ print <<"END";
.if (\\n(.H=4u)&(1m=20u) .ds -- \\(*W\\h'-12u'\\(*W\\h'-8u'-\\" diablo 12 pitch
.ds L" ""
.ds R" ""
+''' \\*(M", \\*(S", \\*(N" and \\*(T" are the equivalent of
+''' \\*(L" and \\*(R", except that they are used on ".xx" lines,
+''' such as .IP and .SH, which do another additional levels of
+''' double-quote interpretation
+.ds M" """
+.ds S" """
+.ds N" """""
+.ds T" """""
.ds L' '
.ds R' '
+.ds M' '
+.ds S' '
+.ds N' '
+.ds T' '
'br\\}
.el\\{\\
.ds -- \\(em\\|
.tr \\*(Tr
.ds L" ``
.ds R" ''
+.ds M" ``
+.ds S" ''
+.ds N" ``
+.ds T" ''
.ds L' `
.ds R' '
+.ds M' `
+.ds S' '
+.ds N' `
+.ds T' '
.ds PI \\(*p
'br\\}
END
@@ -706,9 +726,10 @@ while (<>) {
# trofficate backslashes; must do it before what happens below
s/\\/noremap('\\e')/ge;
- # protect leading periods and quotes against *roff
- # mistaking them for directives
- s/^(?:[A-Z]<)?[.']/\\&$&/gm;
+
+# protect leading periods and quotes against *roff
+# mistaking them for directives
+s/^(?:[A-Z]<)?[.']/\\&$&/gm;
# first hide the escapes in case we need to
# intuit something and get it wrong due to fmting
@@ -837,8 +858,19 @@ while (<>) {
($Cmd, $_) = split(' ', $_, 2);
+ $dotlevel = 1;
+ if ($Cmd eq 'head1') {
+ $dotlevel = 1;
+ }
+ elsif ($Cmd eq 'head2') {
+ $dotlevel = 1;
+ }
+ elsif ($Cmd eq 'item') {
+ $dotlevel = 2;
+ }
+
if (defined $_) {
- &escapes;
+ &escapes($dotlevel);
s/"/""/g;
}
@@ -887,7 +919,7 @@ while (<>) {
if ($needspace) {
&makespace;
}
- &escapes;
+ &escapes(0);
clear_noremap(1);
print $_, "\n";
$needspace = 1;
@@ -919,6 +951,7 @@ sub nobreak {
}
sub escapes {
+ my $indot = shift;
s/X<(.*?)>/mkindex($1)/ge;
@@ -931,9 +964,19 @@ sub escapes {
s/([^"])--"/$1\\*(--"/g;
# fix up quotes; this is somewhat tricky
+ my $dotmacroL = 'L';
+ my $dotmacroR = 'R';
+ if ( $indot == 1 ) {
+ $dotmacroL = 'M';
+ $dotmacroR = 'S';
+ }
+ elsif ( $indot >= 2 ) {
+ $dotmacroL = 'N';
+ $dotmacroR = 'T';
+ }
if (!/""/) {
- s/(^|\s)(['"])/noremap("$1\\*(L$2")/ge;
- s/(['"])($|[\-\s,;\\!?.])/noremap("\\*(R$1$2")/ge;
+ s/(^|\s)(['"])/noremap("$1\\*($dotmacroL$2")/ge;
+ s/(['"])($|[\-\s,;\\!?.])/noremap("\\*($dotmacroR$1$2")/ge;
}
#s/(?!")(?:.)--(?!")(?:.)/\\*(--/g;
diff --git a/pod/splitpod b/pod/splitpod
index 8db4060370..889dfa215a 100755
--- a/pod/splitpod
+++ b/pod/splitpod
@@ -18,7 +18,7 @@ while (<>) {
} else {
#s,L</,L<POSIX/,g;
s,L</,L<perlfunc/,g;
- $pod{$cur} .= $_ if $cur;
+ push @{$pod{$cur} ||= []}, $_ if $cur;
}
}
@@ -27,6 +27,12 @@ for $f ( keys %syn ) {
$flavor = $Flavor{$f};
$orig = $f;
($name = $f) =~ s/\W//g;
+ # deal with unbalanced =over and =back cause by the split
+ my $body = $pod{$orig};
+ my $has_over = $body =~ /^=over/;
+ my $has_back = $body =~ /^=back/;
+ $body =~ s/^=over\s*//m if $has_over and !$has_back;
+ $body =~ s/^=back\s*//m if $has_back and !$has_over;
open (POD, "> $name.pod") || die "can't open $name.pod: $!";
print POD <<EOF;
=head1 NAME
@@ -39,7 +45,7 @@ $syn{$orig}
=head1 DESCRIPTION
-$pod{$orig}
+$body
EOF