Dear Jenda and friends...

I modified the code but the result is still empty.

Please tell me my mistake.
===
Here is my current code:
#!/usr/bin/perl -w
use strict;
use LWP::UserAgent;
use HTML::Parser;

my @result='';
my @judul='';
my @bodi='';
my $tekshslparse='';
my $title='';
my $body='';

my $ua = LWP::UserAgent->new;
$ua->agent("Mozilla/8.0");

my $req = HTTP::Request->new(GET => 'http://www.penguin-teknologi.com');
$req->header('Accept' => 'text/html');

my $retrieveresult = $ua->request($req);

my $p=HTML::Parser->new(text_h=>[\&text,'dtext']);
$p->parse($retrieveresult);
$p->eof;

print "judul:\n";
print @judul;
print "bodi:\n";
print @bodi;

sub text{
        my $text=shift;
        return unless($text=~/\w/);
        if($title){
                push(@judul,$text);
        }elsif($body){
                push(@bodi,$text);
        }
}

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to