dpmott has asked for the wisdom of the Perl Monks concerning the following question:
my $ref;
$ref->{key}; %$ref->{key}; %{$ref}->{key}; $$ref{$key};
$ref->[0]; @$ref->[0]; @{$ref}->[0]; $$ref[0];
$$ref = 1; $$ref;
my $ref = POLYMORPH->new( qw( key in some init values) ); $ref->{key}; # might return 'in' $ref->[0]; # might return 'key' $ref; # depends on implementation
How can I make a single reference that can be LEGALLY DEREFERENCED as a hash ref, array ref, AND a scalar ref, with the resulting operation tied to a class implementation?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(jeffa) Re: I'm looking for some 'heavy magic'
by jeffa (Bishop) on Jan 23, 2002 at 22:59 UTC | |
|
Re: I'm looking for some 'heavy magic'
by Dominus (Parson) on Jan 23, 2002 at 23:31 UTC | |
|
Re: I'm looking for some 'heavy magic'
by goldclaw (Scribe) on Jan 23, 2002 at 23:27 UTC | |
|
Re: I'm looking for some 'heavy magic'
by Anonymous Monk on Jan 24, 2002 at 10:41 UTC | |
by herveus (Prior) on Jan 24, 2002 at 22:04 UTC | |
by Anonymous Monk on Jan 25, 2002 at 10:56 UTC |