in reply to calling subs using references.

I think the replies have spotted the problem and given solution as well. I just want to let you know that you have a serious bug in your constructor so it can't be called by objects. You need to swap the || operands.
my $t = Test->new; my $t1 = $t->new; # Attempt to bless into a reference
I'm aware that this is an example code, and I hope this is not what you have in your real code.

Open source softwares? Share and enjoy. Make profit from them if you can. Yet, share and enjoy!