[svn:perlfaq] r12593 - perlfaq/trunk

[email protected] Mon, 9 Mar 2009 11:25:45 -0700 (PDT)
Newsgroups perl.cvs.perlfaq
Message-ID <[email protected]>
Author: comdog
Date: Mon Mar  9 11:25:42 2009
New Revision: 12593

Modified:
   perlfaq/trunk/perlfaq.pod
   perlfaq/trunk/perlfaq1.pod
   perlfaq/trunk/perlfaq2.pod
   perlfaq/trunk/perlfaq3.pod
   perlfaq/trunk/perlfaq4.pod
   perlfaq/trunk/perlfaq5.pod
   perlfaq/trunk/perlfaq6.pod
   perlfaq/trunk/perlfaq7.pod
   perlfaq/trunk/perlfaq8.pod
   perlfaq/trunk/perlfaq9.pod

Log:
* Update copyright date

* perlfaq9: How do I fetch an HTML file?
	+ get rid of the lynx suggestion!
	+ mention LWP::UserAgent and WWW::Mechanize


Modified: perlfaq/trunk/perlfaq.pod
==============================================================================
--- perlfaq/trunk/perlfaq.pod	(original)
+++ perlfaq/trunk/perlfaq.pod	Mon Mar  9 11:25:42 2009
@@ -60,20 +60,23 @@
 =head1 CREDITS
 
 Tom Christiansen wrote the original perlfaq then expanded it with the
-help of Nat Torkington.  The perlfaq-workers maintain current document
+help of Nat Torkington. The perlfaq-workers maintain current document
 and the dezinens of comp.lang.perl.misc regularly review and update the
 FAQ. Several people have contributed answers, corrections, and comments,
 and the perlfaq notes those contributions wherever appropriate.
 
 =head1 AUTHOR AND COPYRIGHT
 
+Copyright (c) 1997-2009 Tom Christiansen, Nathan Torkington, and
+other authors as noted. All rights reserved.
+
 Tom Christainsen wrote the original version of this document.
 brian d foy C<< <[email protected]> >> wrote this version. See the
 individual perlfaq documents for additional copyright information.
 
 This document is available under the same terms as Perl itself. Code
 examples in all the perlfaq documents are in the public domain. Use
-them as you see fit (and at your own risk with no warranty from anyone).
+them as you see fit and at your own risk with no warranty from anyone.
 
 =head1 Table of Contents
 

Modified: perlfaq/trunk/perlfaq1.pod
==============================================================================
--- perlfaq/trunk/perlfaq1.pod	(original)
+++ perlfaq/trunk/perlfaq1.pod	Mon Mar  9 11:25:42 2009
@@ -405,7 +405,7 @@
 
 =head1 AUTHOR AND COPYRIGHT
 
-Copyright (c) 1997-2008 Tom Christiansen, Nathan Torkington, and
+Copyright (c) 1997-2009 Tom Christiansen, Nathan Torkington, and
 other authors as noted. All rights reserved.
 
 This documentation is free; you can redistribute it and/or modify it

Modified: perlfaq/trunk/perlfaq2.pod
==============================================================================
--- perlfaq/trunk/perlfaq2.pod	(original)
+++ perlfaq/trunk/perlfaq2.pod	Mon Mar  9 11:25:42 2009
@@ -535,7 +535,7 @@
 
 =head1 AUTHOR AND COPYRIGHT
 
-Copyright (c) 1997-2008 Tom Christiansen, Nathan Torkington, and
+Copyright (c) 1997-2009 Tom Christiansen, Nathan Torkington, and
 other authors as noted. All rights reserved.
 
 This documentation is free; you can redistribute it and/or modify it

Modified: perlfaq/trunk/perlfaq3.pod
==============================================================================
--- perlfaq/trunk/perlfaq3.pod	(original)
+++ perlfaq/trunk/perlfaq3.pod	Mon Mar  9 11:25:42 2009
@@ -1091,7 +1091,7 @@
 
 =head1 AUTHOR AND COPYRIGHT
 
-Copyright (c) 1997-2008 Tom Christiansen, Nathan Torkington, and
+Copyright (c) 1997-2009 Tom Christiansen, Nathan Torkington, and
 other authors as noted. All rights reserved.
 
 This documentation is free; you can redistribute it and/or modify it

Modified: perlfaq/trunk/perlfaq4.pod
==============================================================================
--- perlfaq/trunk/perlfaq4.pod	(original)
+++ perlfaq/trunk/perlfaq4.pod	Mon Mar  9 11:25:42 2009
@@ -2489,7 +2489,7 @@
 
 =head1 AUTHOR AND COPYRIGHT
 
-Copyright (c) 1997-2008 Tom Christiansen, Nathan Torkington, and
+Copyright (c) 1997-2009 Tom Christiansen, Nathan Torkington, and
 other authors as noted. All rights reserved.
 
 This documentation is free; you can redistribute it and/or modify it

Modified: perlfaq/trunk/perlfaq5.pod
==============================================================================
--- perlfaq/trunk/perlfaq5.pod	(original)
+++ perlfaq/trunk/perlfaq5.pod	Mon Mar  9 11:25:42 2009
@@ -1441,7 +1441,7 @@
 
 =head1 AUTHOR AND COPYRIGHT
 
-Copyright (c) 1997-2008 Tom Christiansen, Nathan Torkington, and
+Copyright (c) 1997-2009 Tom Christiansen, Nathan Torkington, and
 other authors as noted. All rights reserved.
 
 This documentation is free; you can redistribute it and/or modify it

Modified: perlfaq/trunk/perlfaq6.pod
==============================================================================
--- perlfaq/trunk/perlfaq6.pod	(original)
+++ perlfaq/trunk/perlfaq6.pod	Mon Mar  9 11:25:42 2009
@@ -1138,7 +1138,7 @@
 
 =head1 AUTHOR AND COPYRIGHT
 
-Copyright (c) 1997-2008 Tom Christiansen, Nathan Torkington, and
+Copyright (c) 1997-2009 Tom Christiansen, Nathan Torkington, and
 other authors as noted. All rights reserved.
 
 This documentation is free; you can redistribute it and/or modify it

Modified: perlfaq/trunk/perlfaq7.pod
==============================================================================
--- perlfaq/trunk/perlfaq7.pod	(original)
+++ perlfaq/trunk/perlfaq7.pod	Mon Mar  9 11:25:42 2009
@@ -1080,7 +1080,7 @@
 
 =head1 AUTHOR AND COPYRIGHT
 
-Copyright (c) 1997-2008 Tom Christiansen, Nathan Torkington, and
+Copyright (c) 1997-2009 Tom Christiansen, Nathan Torkington, and
 other authors as noted. All rights reserved.
 
 This documentation is free; you can redistribute it and/or modify it

Modified: perlfaq/trunk/perlfaq8.pod
==============================================================================
--- perlfaq/trunk/perlfaq8.pod	(original)
+++ perlfaq/trunk/perlfaq8.pod	Mon Mar  9 11:25:42 2009
@@ -1377,7 +1377,7 @@
 
 =head1 AUTHOR AND COPYRIGHT
 
-Copyright (c) 1997-2008 Tom Christiansen, Nathan Torkington, and
+Copyright (c) 1997-2009 Tom Christiansen, Nathan Torkington, and
 other authors as noted. All rights reserved.
 
 This documentation is free; you can redistribute it and/or modify it

Modified: perlfaq/trunk/perlfaq9.pod
==============================================================================
--- perlfaq/trunk/perlfaq9.pod	(original)
+++ perlfaq/trunk/perlfaq9.pod	Mon Mar  9 11:25:42 2009
@@ -212,35 +212,25 @@
 
 =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 don't require lynx, but like lynx, can still work
-through proxies:
-
-    # simplest version
-    use LWP::Simple;
-    $content = get($URL);
+(contributed by brian d foy)
 
-    # or print HTML from a URL
-    use LWP::Simple;
-    getprint "http://www.perl.com";
+Use the libwww-perl distribution. The C<LWP::Simple> module can fetch web
+resources and give their content back to you as a string:
 
-    # or print ASCII from HTML from a URL
-    # also need HTML-Tree package from CPAN
-    use LWP::Simple;
-    use HTML::Parser;
-    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;
+    use LWP::Simple qw(get);
+    
+    my $html = get( "http://www.example.com/index.html" );
+    
+It can also store the resource directly in a file:
+
+    use LWP::Simple, qw(getstore);
+    
+    getstore( "http://www.example.com/index.html", "foo.html" );
+    
+If you need to do something more complicated, you can use 
+C<LWP::UserAgent> module to create your own user-agent (e.g. browser)
+to get the job done. If you want to simulate an interactive web
+browser, you can use the C<WWW::Mechanize> module.
 
 =head2 How do I automate an HTML form submission?
 
@@ -692,7 +682,7 @@
 
 =head1 AUTHOR AND COPYRIGHT
 
-Copyright (c) 1997-2008 Tom Christiansen, Nathan Torkington, and
+Copyright (c) 1997-2009 Tom Christiansen, Nathan Torkington, and
 other authors as noted. All rights reserved.
 
 This documentation is free; you can redistribute it and/or modify it