Object IO (Typedef problem)

n/a nforrett at wgz.com
Mon Jul 22 18:56:28 CDT 2002


On Mon, 22 Jul 2002, Jason Annin-White wrote:

> Thank you Randal, I am now using Storable.
> 
> I am still pretty much in the same boat however.  I can't find any perl
> documentation on how to typedef a reference to a custom object.  I have a
> package which I've named PDX::service. When I store and retrieve an
> instance of PDX::service I am left with a reference.  I know how to
> typedef a reference to a scalar, array, or hash, however, I do no know how
> to typedef the reference to be of type PDX::service.
> 
> I've made pitiful attampts such as PDX::service$objref->method() and
> $$objref->method() to no avail.
> 
> ref($objectref) returns main.
> ref($$objectref) returns PDX::service

$obj = $$objectref ;

... should do the trick. Just like a pointer to a pointer to a struct in C.

-- Nick


 ,--< Nick Forrette >--------------------------.
 | e-mail: nforrett at wgz.org                    |
 | www   : http://www.drforehead.net/          |
 `---------------------------------------------'


TIMTOWTDI



More information about the Pdx-pm-list mailing list