Unless we bring overloading in :-). Consider:
{ package FakeScalar; use overload '${}' => sub { \(shift->{scalar}) }; sub new { bless { scalar => undef }, shift }; }; use Scalar::Util qw(reftype); my $scalar = FakeScalar->new; print "reftype(FakeScalar) = ", reftype($scalar), "\n"; print prt_typ( [ $scalar => 'FakeScalar'] ); __END__ # produces reftype(FakeScalar) = HASH ref(FakeScalar) = FakeScalar FakeScalar is SCALAR
In reply to Re^3: Determining the true type of a reference
by adrianh
in thread Determining the true type of a reference
by Mr. Muskrat
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |