#!/usr/bin/perl $U="ronzo"; $P=q/"[test]"/; print "P=$P \n"; $P=~s/\\/\\\\\\\\/g; # escape the \ for shell $P=~s/"/\\"/g; # escape the " for shell $P=~s/'/\\'/g; # escape the ' for shell $P=~s/`/\\`/g; # escape the ` for shell $P=~s/!/\\!/g; # escape the ! for shell print "P=", $P, " \n"; #run ftp command with `` my $a=`(ftp -n -v - <&1`; # a good connect will return a 230 User X Logged In if ($a =~ /230 /) { print "Password Good \n"; } else { print "Password BAD \n"; }