in reply to DBI problem

You are selecting the literal string "passwd", not the column passwd, and so your select is ending up as this:
select "passwd" from table where...
putting placeholders in the column list is not allowed by many db's, and I suspect a bad idea in your case. Just 'select passwd', and leave the first placeholder out of the select statement.