the others that have posted have given good info on some troubleshooting tips. Another (as was suggested, there may be whitespace at the end that's fouling you up) is to try:
# get rid of trailing whitespace
chomp $rest;
# split on consecutive whitespace
# (includes tabs and mult spaces)
@rest_ary = split(/\s+/, $rest);
# grab last item
$pass = $rest_ary[$#rest_ary];
print "pass = $pass\n";
# just to double check -
for ($x = 0; $x <= $#rest; $x++) {
print "array item $x = $rest[$x]\n";
}
That may shed some light...
-Syn0