Each link returned is a WWW::Mechanize::Link object.  You need to use the
methods supplied to get the info.

See:
http://search.cpan.org/~petdance/WWW-Mechanize-0.59/lib/WWW/Mechanize/Link.p
m

Use it like this...

@LINKS = $agent->links();
foreach (@LINKS) {
  print $_->url(), "\n";
  print $_->text(), "\n";
  print $_->name(), "\n";
  print $_->tag(), "\n";
}


Rob


-----Original Message-----
From: Dave Odell [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 11, 2003 2:16 PM
To: [EMAIL PROTECTED]
Subject: WWW::Mechanize ->links() problem


Question:
I'm trying to use the links(); function which in the man page says
"returns a list of the links found in the last fetched page. "
However when I try

@LINKS =  $agent->links();
foreach(@LINKS){
        print "$_\n";
                    }
it returns

WWW::Mechanize::Link=ARRAY(0x84a731c)

Does this mean it's an reference or does it return and array and I'm
just using it incorrectly? 
 If it is a reference is there a good tutorial around for using them.

Thanks

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to