my $ssh = login($user, $pass, $host); test(\$ssh);
$ssh is already a blessed reference. If you pass it to test() like test(\$ssh), you are passing an unblessed reference to a blessed reference. You should pass it to test like test($ssh).
Update: See also
--MidLifeXis
In reply to Re: Pass object to subroutine.
by MidLifeXis
in thread Pass object to subroutine.
by tacoking92
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |