in reply to Re^2: ref eq "REF"
in thread ref == "REF"

I'm sure Data::Dumper couldn't have been written without ref to a reference returning REF.

Replies are listed 'Best First'.
Re^4: ref eq "REF"
by gaal (Parson) on Oct 18, 2004 at 14:09 UTC
    Why's that? It could have worked just fine if ref had returned SCALAR in this case.

    In fact, there's only place in Dumper.pm where REF is mentioned at all. Here's what it says:

    if ($realtype eq 'SCALAR' || $realtype eq 'REF')

    Clearly, Dumper would have lived just fine with "a reference is just a scalar" semantics.

      So it would seem. I was just thinking that the reference is a reference, a SCALAR is something different would seem to be the easier. As you say, Data::Dumper would have lived just fine (better, even). I should have looked at the source myself before writing that.