in reply to Re^6: Inheritance problem: Not a HASH ref
in thread Inheritance problem: Not a HASH ref

do not subclass me, I don't like to play ball this way

Just because it isn't a hash that doesn't mean you can't inherit from it. It's just implemented in a way that makes using the more traditional way of implementing objects not work. "OOP" has little to do with hashes IMO.

Subclassing of Furl is still easy. You can easily write a subclass My::Furl that overrides methods on it. What is hard is attaching additional information to the object. You've been shown various ways on how to associate information with the objects.

  • Comment on Re^7: Inheritance problem: Not a HASH ref

Replies are listed 'Best First'.
Re^8: Inheritance problem: Not a HASH ref
by bliako (Abbot) on Feb 26, 2019 at 22:24 UTC

    Yes, I got the various ways of attaching info to such objects (confession: $$self->{'xyz'} = 42 is what I would seek first - and I should have realised myself) thanks to the respondents to this question. It's just I sense that maybe is not a "good" thing to do, given that the author did not make it explicit/easy to subclass for users.

    Btw, from Furl's source I see in new()

    ... return bless \(Furl::HTTP->new(header_format => Furl::HTTP::HEADERS_AS +_HASHREF(), @_)), $class;

    And now I wonder whether this "special" blessing which has been tormenting me was just because of not wanting to explicitly subclass.