if ($@) { if ($@ =~ /Connection refused/) { print "Denied199"; $tssshtest = 2; } } else { if ($ssh = Net::SSH::Perl->new($tsip, protocol=>1)) { $ssh -> login ($username, $password); print "Granted"; $tssshtest = 1; } else { print "Denied"; $tssshtest = 0; } }