|Pathologically Eclectic Rubbish Lister|
"cleaning out" object databy Forsaken (Friar)
|on May 20, 2005 at 07:32 UTC||Need Help??|
Forsaken has asked for the
wisdom of the Perl Monks concerning the following question:
assuming I have a classic object, ie a blessed anonymous hash, which contains a chunk of data, and I want to clean out the data without actually deleting the object itself, what would be the best way to go about it? So far all I've been able to come up with would to be a
kind of solution but there has to be a better approach to this. Is there one? I searched the docs extensively but was unable to come up with a better idea.
edit: small example to clarify what I mean
edit 2: put the example between readmore tags.
Now our Celebrity doesn't care who the actual guard is, he/she just wants to sleep() safely. So the object itself needs to take care of cleaning out the data without having to bother the calling script. Hope that clears it up a bit :-)
Remember rule one...
Edit by castaway - added missing closing small tag