in reply to ref == "REF"
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.
$ perl -wle 'use strict; my $x = 1; my $y = \$x; my $z = \$y; print "Y +: ", ref($y), " Z: ", ref($z)' Y: SCALAR Z: REF $
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
|
|---|