RE: Inflating and deflating

[prev] [thread] [next] [Date index for 2005/02/15]

From: Addison, Mark
Subject: RE: Inflating and deflating
Date: 17:21 on 15 Feb 2005
From: Perrin Harkins Sent: 14 February 2005 20:19
>=20
> On Mon, 2005-02-14 at 12:40 +0000, Addison, Mark wrote:
> > > Don't you get a warning when you redefine that sub?  They are both
> > being put into the same namespace.
> >=20
> > No, Class::Accessor sorts it. It installs the method under both
names
> > (e.g. foo and _foo_accessor) but only if that name hasn't already be
> > used (ie by your own sub).
>=20
> I did a quick test on one of my classes, and I'm not getting=20
> the warning
> I thought I would, but I don't really understand why not.
> Class::Accessor looks like it defines the methods *before* your own
> methods, since it happens when you call set_up_table() or list the
> columns.  I must be missing something here.

Perl compiles the code first, setting up the symbol table entries,
like your methods, before running the package code, like=20
set_up_table. That way the subs have already been defined when
Class::Accessor does its thing.

> It's not really that important though, since there a number of
> techniques that seem to work for this.

Indeed, it is perl after all ;-)
Hmmm, probably worth a wiki node though...

mark
--


This email (and any attachments) is intended solely for the individual(s) t=
o whom addressed.=20
It may contain confidential and/or legally privileged information.=20
Any statement or opinions therein are not necessarily those of ITN unless s=
pecifically stated.=20
Any unauthorised use, disclosure or copying is prohibited.=20
If you have received this email in error, please notify the sender and dele=
te it from your system.=20
Security and reliability of the e-mail and attachments are not guaranteed.=20
You must take full responsibility for virus checking.



Independent Television News Limited,=20

Registered No. 548648 England,

VAT Reg. No: GB 756 2995 81,=20

200 Gray's Inn Road, London WC1X 8XZ,

Telephone: 020 7833 3000.

Inflating and deflating
Simon Wilcox 19:19 on 05 Feb 2005

RE: Inflating and deflating
22:39 on 05 Feb 2005

Re: Inflating and deflating
Perrin Harkins 23:42 on 05 Feb 2005

Solved // RE: Inflating and deflating
Simon Wilcox 23:17 on 06 Feb 2005

RE: Inflating and deflating
Addison, Mark 11:07 on 08 Feb 2005

RE: Inflating and deflating
Perrin Harkins 16:21 on 08 Feb 2005

RE: Inflating and deflating
Addison, Mark 17:52 on 10 Feb 2005

RE: Inflating and deflating
Perrin Harkins 18:03 on 10 Feb 2005

RE: Inflating and deflating
Addison, Mark 12:40 on 14 Feb 2005

RE: Inflating and deflating
Perrin Harkins 20:19 on 14 Feb 2005

RE: Inflating and deflating
Addison, Mark 17:21 on 15 Feb 2005

Generated at 17:31 on 15 Feb 2005 by mariachi v0.52