in reply to SQL quoting problem
$dbh->do(qq{exec qp_MyStoredProg \@foo='} . $dbh->quote($bar) . "'");
Take that as untested and only offered because no one else has given a more definitive answer yet.