in reply to Re: What are all the Perl data types?
in thread What are all the Perl data types?

That's interesting. Perhaps, basically, it's whether or not one of the types above are blessed? Otherwise any blessed scalar is another type? That also makes me wonder if we could count iterators somehow.

-Paul

  • Comment on Re^2: What are all the Perl data types?

Replies are listed 'Best First'.
Re^3: What are all the Perl data types?
by kyle (Abbot) on May 03, 2007 at 11:17 UTC

    Otherwise any blessed scalar is another type?

    I tend to think that a scalar has a reference to a blessed thing rather than the scalar itself being blessed.

    my $unblessed = {}; my $blessed = $unblessed; bless $blessed, 'Holy::Holy'; printf "%s\n%s\n", ref $unblessed, ref $blessed; __END__ Holy::Holy Holy::Holy

    That's just a nitpick, though.

    I ordinarily wouldn't think of some user-created object as being a separate data type except that they can be overloaded to act just like one. Where does something like Math::BigInt fit in? I think this is a point on which reasonable people can disagree.

    That also makes me wonder if we could count iterators somehow.

    I don't know what you mean by this.

      Just a nitpick back: "sv_bless(SV* sv, HV* stash);" (perlguts); it really is the scalar that's blessed, rather than the other way around.

      I think this is a point on which reasonable people can disagree.

      I just recently read a discussion on (usenet or a mailinglist) about how the discussion of dynamically vs statically typed doesn't really make any sense unless you agree on the parameters before hand. I suspect this is sorta the same thing.

      -Paul