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

This is NOT a good idea (Breaks encapsulation) .. but it could work for a POC for this case:
$$self->{MyAdditionToFURL}= "MyValue"; #<< Extra "$" here, to access the extra indirection used by 'furl'
(UNTESTED)

                As a computer, I find your faith in technology amusing.

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

    Thanks for the word of caution NetWallah and stevieb. Stability is in the *$^&£@&* of the beholder, I say, though it sounds cockier than it is.

    As a side remark, personally I would never publish anything which can not be expanded or inherited by 3rd party. If I can't do it, even if it is "lightning fast" I would consign it to the catacombs. But everyone is different and everyone has their reasons and not everyone can write "lightning fast" browsers.

    For the record, Furl does not offer adding callbacks (LWP::UserAgent's add_handler()) to be called at the various phases of the transaction, so it does not serve my purpose. I ended using LWP::Protocol::Net::Curl which, so far, keeps its word as "drop-in curl replacement for LWP::UserAgent", including callbacks and some speed improvement by mere use LWP::Protocol::Net::Curl; uuse parent 'LWP::UserAgent';

    bw, bliako

Re^4: Inheritance problem: Not a HASH ref
by bliako (Abbot) on Feb 26, 2019 at 14:03 UTC
    Breaks encapsulation

    I have been regurgitating this for awhile and I wonder if it isn't too extreme. In the sense of "since when inheritance breaks encapsulation?"

        Child classes shouldn't rely on private implementation details of their superclass.

        Fine tobyink, clear and acceptable. Albeit (I am talking in general and not for some module mentioned here), a hint in the pod a la "do not subclass me, I don't like to play ball this way" would have gone further than trying to obscure. My opinion, for what is worth, is that if you write OOP then play OOP. Exhibhit your private parts but with ample of warnings not to be touched and allow for some kind of subclassing for some of your public functioning so as to move the state-of-the-art a click forward.

        bw, bliako

Re^4: Inheritance problem: Not a HASH ref
by bliako (Abbot) on Feb 25, 2019 at 19:40 UTC

    that works, thanks

      Understand clearly that NetWallah is suggesting something that can break things very easily and subtly.

      Please review that post, where it was said "not a good idea".

      Do not break things like this. Do not work this way. It was a concept piece of code that shows 'how' you could do something, not how you *should* do something.

      If you continue on this path now, you'll do so going forward. Don't.

      Proof of Concept chunks of code are just that... tests.