diff options
author | Tom Christiansen <tchrist@perl.com> | 1999-01-07 16:05:02 -0700 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 1999-01-08 11:51:52 +0000 |
commit | 65acb1b1d672587d3a0d073613a475584830e38e (patch) | |
tree | fcb09719fada1c9453493712a798b889dd89b086 /pod/perlfaq9.pod | |
parent | ae83f3772b2dd371e676035c6714025e89d7e08f (diff) | |
download | perl-65acb1b1d672587d3a0d073613a475584830e38e.tar.gz |
FAQ jumbo patch from tchrist.
Message-Id: <199901080605.XAA20229@jhereg.perl.com>
To: pumpkings@jhereg.perl.com
Subject: newest version of perlfaq.pod
Date: Thu, 7 Jan 1999 23:05:02 -0700
Message-Id: <199901080605.XAA20231@jhereg.perl.com>
From: Tom Christiansen <tchrist@jhereg.perl.com>
To: pumpkings@jhereg.perl.com
Subject: newest version of perlfaq1.pod
Date: Thu, 7 Jan 1999 23:05:02 -0700
Message-Id: <199901080605.XAA20233@jhereg.perl.com>
From: Tom Christiansen <tchrist@jhereg.perl.com>
To: pumpkings@jhereg.perl.com
Subject: newest version of perlfaq2.pod
Date: Thu, 7 Jan 1999 23:05:02 -0700
Message-Id: <199901080605.XAA20235@jhereg.perl.com>
From: Tom Christiansen <tchrist@jhereg.perl.com>
To: pumpkings@jhereg.perl.com
Subject: newest version of perlfaq3.pod
Date: Thu, 7 Jan 1999 23:05:02 -0700
Message-Id: <199901080605.XAA20237@jhereg.perl.com>
From: Tom Christiansen <tchrist@jhereg.perl.com>
To: pumpkings@jhereg.perl.com
Subject: newest version of perlfaq4.pod
Date: Thu, 7 Jan 1999 23:05:02 -0700
Message-Id: <199901080605.XAA20239@jhereg.perl.com>
From: Tom Christiansen <tchrist@jhereg.perl.com>
To: pumpkings@jhereg.perl.com
Subject: newest version of perlfaq5.pod
Date: Thu, 7 Jan 1999 23:05:02 -0700
Message-Id: <199901080605.XAA20241@jhereg.perl.com>
From: Tom Christiansen <tchrist@jhereg.perl.com>
To: pumpkings@jhereg.perl.com
Subject: newest version of perlfaq6.pod
Date: Thu, 7 Jan 1999 23:05:02 -0700
Message-Id: <199901080605.XAA20243@jhereg.perl.com>
From: Tom Christiansen <tchrist@jhereg.perl.com>
To: pumpkings@jhereg.perl.com
Subject: newest version of perlfaq7.pod
Date: Thu, 7 Jan 1999 23:05:03 -0700
Message-Id: <199901080605.XAA20245@jhereg.perl.com>
From: Tom Christiansen <tchrist@jhereg.perl.com>
To: pumpkings@jhereg.perl.com
Subject: newest version of perlfaq8.pod
Date: Thu, 7 Jan 1999 23:05:03 -0700
Message-Id: <199901080605.XAA20257@jhereg.perl.com>
From: Tom Christiansen <tchrist@jhereg.perl.com>
To: pumpkings@jhereg.perl.com
Subject: newest version of perlfaq9.pod
Date: Thu, 7 Jan 1999 23:05:03 -0700
p4raw-id: //depot/cfgperl@2588
Diffstat (limited to 'pod/perlfaq9.pod')
-rw-r--r-- | pod/perlfaq9.pod | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/pod/perlfaq9.pod b/pod/perlfaq9.pod index 1a5e61feee..46c487bea3 100644 --- a/pod/perlfaq9.pod +++ b/pod/perlfaq9.pod @@ -1,6 +1,6 @@ =head1 NAME -perlfaq9 - Networking ($Revision: 1.20 $, $Date: 1998/06/22 18:31:09 $) +perlfaq9 - Networking ($Revision: 1.24 $, $Date: 1999/01/08 05:39:48 $) =head1 DESCRIPTION @@ -77,8 +77,7 @@ stamp prepended. =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). +from CPAN (part of the HTML-Tree package on CPAN). 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 @@ -172,6 +171,7 @@ do this. They work through proxies, and don't require lynx: getprint "http://www.sn.no/libwww-perl/"; # or print ASCII from HTML from a URL + # also need HTML-Tree package from CPAN use LWP::Simple; use HTML::Parse; use HTML::FormatText; @@ -303,7 +303,7 @@ In short, they're bad hacks. Resist them at all costs. 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). +http://cgi-lib.stanford.edu/cgi-lib/ ). Make sure you know whether to use a GET or a POST in your form. GETs should only be used for something that doesn't update the server. @@ -387,7 +387,7 @@ 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($<))[0], hostname); + $address = sprintf('%s@%s', getpwuid($<), hostname); Company policies on mail address can mean that this generates addresses that the company's mail system will not accept, so you should ask for @@ -411,7 +411,8 @@ Use the C<sendmail> program directly: To: Final Destination <you\@otherhost> Subject: A relevant subject line - Body of the message goes here, in as many lines as you like. + Body of the message goes here after the blank line + in as many lines as you like. EOF close(SENDMAIL) or warn "sendmail didn't close nicely"; @@ -442,9 +443,8 @@ include queueing, MX records, and security. =head2 How do I read 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). +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; @@ -504,7 +504,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($name)) || 'localhost'); + my $addr = inet_ntoa(scalar gethostbyname($host || '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 @@ -531,11 +531,12 @@ available from CPAN) is more complex but can put as well as fetch. 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. +CPAN). The rpcgen suite, available from CPAN/authors/id/JAKE/, is +an RPC stub generator and includes an RPC::ONC module. =head1 AUTHOR AND COPYRIGHT -Copyright (c) 1997, 1998 Tom Christiansen and Nathan Torkington. +Copyright (c) 1997-1999 Tom Christiansen and Nathan Torkington. All rights reserved. When included as part of the Standard Version of Perl, or as part of @@ -550,3 +551,4 @@ are hereby placed into the public domain. You are permitted and encouraged to use this code in your own programs for fun or for profit as you see fit. A simple comment in the code giving credit would be courteous but is not required. + |