Problems? Is your data what you think it is? | |
PerlMonks |
Re: ref == "REF"by Prior Nacre V (Hermit) |
on Oct 18, 2004 at 10:25 UTC ( [id://400111]=note: print w/replies, xml ) | Need Help?? |
SCALAR is a reference to a scalar; HASH is a reference to a hash; and so on (ARRAY, CODE, ...). REF is a reference to any of those, e.g.
I vaguely recall using this feature some time ago when testing some deep copying of a complex data structure although I can't remember the exact details. The basic idea was to continually dereference to a scalar while ref() returned REF (e.g. $deref = $$ref); then to deference to the appropriate datatype (e.g. @array = @$ref if ref($ref) eq 'ARRAY'). I can't provide any help with the internals. Regards, PN5
In Section
Seekers of Perl Wisdom
|
|