in reply to accessing Cisco via SSH

I would definitely start with use strict. In this case I don't know where you get the TRUE and FALSE constants because those don't normally exist in perl. This means that when $ssh = FALSE then if ($ssh) still evaluates to true.

As far as "Doesn't work with SSH devices", you weren't very clear on what doesn't work and what sort of errors you are getting from that so I am not sure how much I can help.