Skip Menu |

This queue is for tickets about the Class-Std CPAN distribution.

Report information
The Basics
Id: 25969
Status: open
Priority: 0/
Queue: Class-Std

People
Owner: Nobody in particular
Requestors: nodine [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: v0.0.8
Fixed in: (no value)



Subject: AUTOMETHOD sees different address for attributes
The AUTOMETHOD sees a different address for the attribute variables from those seen outside of it. If the only use of the attribute variables is from within the AUTOMETHOD, then there is no problem, since it gets a consistent version, but if there are other uses of the attribute variables, they fail because the attributes are based at a different address. As an example, I've attached a slightly modified version of the phonebook program that was used as an example in the documentation for Class::Std. The modifications are: 1. There is a BUILD routine to pre-initialize the phone number for directory assistance ("Assist") into the phone book. 2. There are additional routine "get_Glenn2" and "get_Assist2" which are hard-coded to produce the phone number for "Glenn" and "Assist", respectively. 3. There are printouts of trying to get the phone number for directory assistance using get_Assist, for Glen using get_Glenn2, and for assistance using get_Assist2. Both get_Assist (using AUTOMETHOD) and get_Glenn2 produce a null value, while get_Assist correctly returns the result stored in the BUILD routine. If you trace in the debugger and do a Show quoted text
> x \%entries_of
from within AUTOMETHOD and BUILD/get_Glenn2/get_Assist, you'll see that AUTOMETHOD thinks %entries_of is at a different address from the other three. Checked on perl 5.8.8 and 5.8.0.
Subject: pb.prl
Download pb.prl
application/octet-stream 1.3k

Message body not shown because it is not plain text.

On Fri Mar 30 11:16:26 2007, NODINE wrote: Show quoted text
> The AUTOMETHOD sees a different address for the attribute variables from > those seen outside of it.
What I'm trying to say is that the AUTOMETHOD routine operates from within a different closure from the one the other routines operate in.