in reply to Login to a remote solaris machine as superuser through perl
Rather, you could use keys (RSA or DSA keys for SSH protocol version 2). You can take a look to the ssh-keygen(1) manpage for details.