try perldoc DBI from command line for more information on how to use DBI, or perldoc perldoc for help with perldoc.
$sth = $dbh->prepare("SELECT foo, bar FROM table WHERE baz=?");
$sth->execute( $baz );
while ( @row = $sth->fetchrow_array ) {
print "@row\n";
}
padmaja3, not escaping user provided parameters could open your script to an attack known as sql injection. If you use $dbh->prepare() and the ? placeholder for parameters you can avoid that security hole.