Attempt to bless into a reference (perl)

It’s saying this because for some reason the second param to bless in your ->new() constuctor is not the name of the Object you want your reference to be, but instead it is itself a reference!

It could be that you’re passing a string reference to bless rather than a string itself in which case you’ll need to double $$ it. But in my case, like a donkey, I’d written:

my $fish = new Fish->new();

Fantastic.

I’ve just done it again oddly. No more than an hour later.
This time. I’ve tried to create a new object from it’s own handle. i.e.

$self->new();

rather than

TheClassName->new();

So bless is getting $self rather than “TheClassName” as it’s second parameter.