RE: Inflating and deflating
[prev]
[thread]
[next]
[Date index for 2005/02/15]
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.
|
|
RE: Inflating and deflating
Addison, Mark 17:21 on 15 Feb 2005
|