P is for Practical | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Dear monks,
After being away from Perl for a year, i'm back, and i seek new wisdom :)
In the .Net platform an object is stored in the heap. When passing the object 'as value' and not as a reference, the object itself isn't copied, you still get a reference to it (instead of a fresh copy). If you want a copy (like items on the stack), you need to deep copy (clone) the object by hand. I wonder how this is done in Perl, since i could not find any info on it. Thanks again :) edit: as just stated by jkva (and the others below (thanks) ).... an object in Perl already IS a reference... So it stays a reference as it's passed :). In reply to VB-ish behaviour byVar or byRef of objects in Perl by jbrugger
|
|