Extracting properties from objects.

Extracting properties from objects.

am 24.01.2011 11:17:13 von Sean Murphy

------=_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=20


------=_NextPart_000_0073_01CBBC0C.121A3D10--

Re: Extracting properties from objects.

am 24.01.2011 17:45:44 von Ben Lavery

--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.
>=20
> 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:
>=20
> my $l =3D $mec->find_link (text =3D> 'link');
>=20
> 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.
>=20
> Sean=20
>=20


--Apple-Mail-1--247235140--