Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: "cleaning out" object data

by holli (Abbot)
on May 20, 2005 at 07:48 UTC ( [id://458870]=note: print w/replies, xml ) Need Help??


in reply to "cleaning out" object data

You could simply bless an empty hash with the classname of the object.
$obj = bless {}, ref($obj);


holli, /regexed monk/

Replies are listed 'Best First'.
Re^2: "cleaning out" object data
by Forsaken (Friar) on May 20, 2005 at 07:58 UTC
    That would make $obj point to a new object within its own scope, but all other references to the original object would still be intact, as would the data stored in the original object. I'll make a small example in the OP to clarify.

    Remember rule one...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://458870]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-04-18 21:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found