Conveniently, the "connect.c" program everybody seems to mention here no longer exists. The tubes are littered with dead links to it.
Dante "socksify" no longer works, either. Newer versions of libc or the Linux kernel did something that makes it so that calls to connect() et al. are linked to the real versions from libc, and not Dante's versions.
That leaves no way to use anything other than a Web browser over SOCKS.
Not too long ago I was able to successfully use tsocks. See also the list of similar programs maintained by Debian for other alternatives.
Anyway, nowadays I would forget about Net::SSH::Perl and instead, use Net::OpenSSH that can use and external program (i.e. socat) to establish the connection to the remote server... though, it does not work on Windows.