in reply to Most efficient way to share blessed refence among packages
The constructor can of course do with lots more error checking to make it robust, but this should give you an idea on how to proceed. The methods in Queue can than use the Registry attribute to access the registry object through the reference.use strict; package Queue; sub new { my ($self,$registry)=@_; return bless {'Registry'=>$registry}, ref($self)||$self; } # This code is untested, and might conceivably not work, # or work in strange and unpredictable ways not # excluding FedEx'ing a camel to your doorstep.
CU
Robartes-
|
|---|