[Tokyo.pm] Re: Ten Perl Myths
scozens @ pwj.co.jp
scozens @ pwj.co.jp
2000年 3月 9日 (木) 20:48:36 CST
カズンズです。
> > perl -MLWP::Simple -MHTML::Parser -MHTML::FormatText -e
> > 'print
> > HTML::FormatText->new->format(parse_html(get("http://www.perl.com
")))
> > '
> これ動きます?
> perl -MLWP::Simple -MHTML::TreeBuilder -MHTML::FormatText -e
> '$h=new HTML::TreeBuilder;
> print HTML::FormatText->new->format($h->parse(get("http://www.perl.com/
"))'
> ってなると思うんですが。
うん、実といえば、分かりません。 perldoc -q HTMLから取っていました。
=head2 How do I fetch an HTML file?
...
# 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;
だけど、モジュールが変化された可能があります。
そういうことならば、perlfaq-suggestions @ perl.comにpatchを送ってください…
Tokyo-pm メーリングリストの案内