Thanks -= Ozzy =-, I'm not sure how I missed that.
I still need help with the Internal Server Error though.
-Etan
P.S. code is as above but "$q->redirect("works.html");" changed to
"print $q->redirect("works.html");"
and added "close PASSWD;" after the end of the while loop