Extracting properties from objects.

------=_NextPart_000_0073_01CBBC0C.121A3D10
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi All.

I am wondering how do you extract properties from objects. If we use =
WWW:Mechanize as an example. How would you get the properties of the =
first link. Lets say:

my $l =3D $mec->find_link (text =3D> 'link');

So I would like to find out the text of the link, URL, attribs, etc. =
This is just an example. When I review the CPAN doc, they don't show =
this type of information.

Sean


------=_NextPart_000_0073_01CBBC0C.121A3D10--
Sean Murphy [ Mo, 24 Januar 2011 11:17 ] [ ID #2053749 ]

Re: Extracting properties from objects.

--Apple-Mail-1--247235140
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
charset=us-ascii

Hi Sean,

In your given example, $l becomes a link object, so you go:
$l->url(); to get the URL, for example.

After using your code below, look at this page: =
http://search.cpan.org/~petdance/WWW-Mechanize-1.66/lib/WWW/ Mechanize/Link=
..pm
That will show you how to use $l.

Hope that helps,
Ben

On 24 Jan 2011, at 10:17, Sean Murphy wrote:

> Hi All.
>
> I am wondering how do you extract properties from objects. If we use =
WWW:Mechanize as an example. How would you get the properties of the =
first link. Lets say:
>
> my $l =3D $mec->find_link (text =3D> 'link');
>
> So I would like to find out the text of the link, URL, attribs, etc. =
This is just an example. When I review the CPAN doc, they don't show =
this type of information.
>
> Sean
>


--Apple-Mail-1--247235140--
Ben Lavery [ Mo, 24 Januar 2011 17:45 ] [ ID #2053758 ]
Perl » gmane.comp.lang.perl.beginners » Extracting properties from objects.

Vorheriges Thema: Lighttpd + FCGI = Socket not closing?
Nächstes Thema: How to monitor Windows CPU usage in Linux Server