In DEC OSF aka Digital UNIX aka Tru64 add the version
[p5sagit/p5-mst-13.2.git] / pod / perlfaq9.pod
index 2443fc9..d1bd593 100644 (file)
@@ -20,7 +20,7 @@ may not be so well received.
 The useful FAQs and related documents are:
 
     CGI FAQ
-        http://www.webthing.com/page.cgi/cgifaq
+        http://www.webthing.com/tutorials/cgifaq.html
 
     Web FAQ
         http://www.boutell.com/faq/
@@ -77,10 +77,12 @@ stamp prepended.
 =head2 How do I remove HTML from a string?
 
 The most correct way (albeit not the fastest) is to use HTML::Parser
-from CPAN (part of the HTML-Tree package on CPAN).
+from CPAN.  Another mostly correct
+way is to use HTML::FormatText which not only removes HTML but also
+attempts to do a little simple formatting of the resulting plain text.
 
 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
+C<< s/<.*?>//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.
@@ -146,7 +148,7 @@ 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
+Use the B<< <SELECT> >> and B<< <OPTION> >> 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.
 
@@ -168,7 +170,7 @@ through proxies:
 
     # or print HTML from a URL
     use LWP::Simple;
-    getprint "http://www.sn.no/libwww-perl/";
+    getprint "http://www.linpro.no/lwp/";
 
     # or print ASCII from HTML from a URL
     # also need HTML-Tree package from CPAN
@@ -213,11 +215,12 @@ Here's an example of decoding:
     $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.
+all characters that are not letters, digits or underscores (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.
+available from CPAN.
 
 =head2 How do I redirect to another page?
 
@@ -394,12 +397,12 @@ format after minor transliterations:
 
 =head2 How do I return the user's mail address?
 
-On systems that support getpwuid, the $E<lt> variable and the
+On systems that support getpwuid, the $< 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);
+    $address = sprintf('%s@%s', scalar 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