Greetings patient Monks,
I create a module which inherits from Furl. I want to enhance it with a few own variables. However, it does not work with Furl. Furl->new() returns something like Furl=REF(0x1bfd858) and its dump shows that its data is enclosed in an array(ref) like so: bless(do{\(my $o = bless({....
Usually, this works for me:
package XYZ; use strict; use warnings; our $VERSION = 1; use parent 'LWP::UserAgent'; sub new { my $class = $_[0]; my $self = $class->SUPER::new(); bless($self, $class); # rebless to our own class # setting some own data in self: $self->{'debug'} = 1; $self->{'ABC'} = 42; return $self }
LWP::UserAgent's new() returns LWP::UserAgent=HASH(0x5643905a0d68) (and its dump is like bless({...). That is a hashref where I add my own variables, as in the above code. Buf Furl's new() returns Furl=REF(0x1bfd858) which stubbornly refuses to be accessed.
How can I add my own data in my own module inheriting from Furl?
many thanks, bliako
In reply to Inheritance problem: Not a HASH ref by bliako
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |