I am creating a child class having base class as Net::SSH2. when I am trying to add a class variable I am getting error saying -
Not a HASH reference at F:\temp\fooA.pl line 17.
If I do the same thing wihtout Net::SSH2 then it works fine.
Here is the code :
use strict;
my $x = Foo->new();
package Foo;
use base qw (Net::SSH2);
sub new {
my ($class, %args) = @_;
my $self = $class->SUPER::new(%args);
$self->{'key'} = 'value';
bless $self, $class;
return $self;
}