hello again all.
i tried a lot for the solution using DBI in perl but i'vent got any success so far. as i've read in docs, i've also tried turning off the buffering in perl using "$|=1" but it didnt help me.
then, i changed the database module in perl and now instead using DBI, i'm using "Mysql.pm" module and it is working fine with that.
so now my perl script looks something like this.
Code:
--------------------------------------------------------------------------------------------------
perl_auth.pl
------------
#!/usr/bin/perl
$|=1;
use Mysql;
$DBHOST = "localhost";
$DBNAME = "mysql_auth";
$DBUSER = "root";
$DBPASS = "";
$DB = Mysql->connect($DBHOST, $DBNAME, $DBUSER, $DBPASS);
$DB->selectdb($DBNAME);
while(<STDIN>)
{
chomp ;
@login = split(/ /);
$user = $login[0];
$passwd = $login[1];
$qry= "select * from data where user='$user' and password='$passwd'";
$sth = $DB->query( $qry);
@emps = $sth->fetchrow;
my $len = @emps;
if($len >1)
{
print "OK\n";
}
else
{
print "ERR\n";
}
}
Mysql->disconnect($DB);
--------------------------------------------------------------------------------------------------
i hope this information will help others who are having same difficulty as me.
Any advice or suggestions are invited.
-Pratik H Pandya.