Help for this page
ssh -fNg -L 6603:127.0.0.1:3306 remote_user@mysql.example.com
my $ssh_pid= open("ssh -fNg -L 6603:127.0.0.1:3306 remote_user@mysql.e +xample.com |") or die; ... # tear down the connection kill -9 => $ssh_pid;