Re: multiple lines / success or failure?!

From: Joe Smith (Joe.Smith_at_inwap.com)
Date: 03/31/04


Date: Wed, 31 Mar 2004 10:43:51 GMT

Geoff Cox wrote:
> I have not tried HTML::Parser yet as I cannot find any help info to
> get me started.

#!/usr/bin/perl -w
# Name: nohtml Author: Joe.Smith@inwap.com 07-Nov-2001
# Purpose: Extracts just the text portions of a document.

   use strict;
   use HTML::Parser ();

   sub text_handler { # Ordinary text
     print @_;
   }

   my $p = HTML::Parser->new(api_version => 3);
   $p->handler( text => \&text_handler, "dtext");
   $p->parse_file(shift || "-") || die $!;

1;



Relevant Pages

  • Re: Removing HTML
    ... I whipped up this little ditty to show it's easy. ... # Purpose: Extracts just the text portions of a document. ...
    (comp.lang.perl.misc)
  • Re: Need a Module Similar to lynx in Perl
    ... For just text, it is straight forward. ... # Purpose: Extracts just the text portions of a document. ...
    (comp.lang.perl.misc)
  • Re: Posting complaint Was: I dont believe that Rubens wrote this
    ... the purpose was to encourage early snipping of useless ... portions, and to encourage not snipping essential portions, and ... thus to make the newsgroup more usable for all. ...
    (rec.games.bridge)
  • Re: New to UML
    ... model a coffee shop. ... A modeling task is not well-defined unless the interest ... A model always extracts certain aspects ... purpose is known. ...
    (comp.object)