in reply to Strict Ref : ERROR

Your code makes no sense. You prepare a complete-yet-broken SQL statement and then try to use bind_params to interpolate variables into it. This will not work. Maybe you can adapt the following example of inserting data into a database to your needs:

my $sql = <<SQL INSERT INTO acct1( date, time, RAS_CLIENT, Called_Station_Id, Calling_Station_Id, Acct_Input_Octets, Acct_Output_Octets, Acct_Session_Time, Acct_Input_Packets, Acct_Output_Packets, Acct_Termination_Cause) VALUES (?,?,?,?,?,?,?,?,?,?,?)"; warn $sql; my $sth = $dbh->prepare($sql); while (<LOG>){ chomp; my @values = split(',',$_); # what do you do if one value contains a comma? # remove quotes here $sth->execute(@values); };

I suspect that you will have many, many problems as the logic of your program is very twisted. Consider writing on small sheets of paper the steps your program needs to perform, and only one small unit per sheet of paper. You reopen the connection to the database for every line from your logfile - that's not very efficient.

Replies are listed 'Best First'.
Re^2: Strict Ref : ERROR
by swetashah23 (Initiate) on Jun 28, 2006 at 17:43 UTC
    Corion, Thanks again.. my first script looked just like that and it s +aid there was an error near ?,?,?) However, I will surely try this on +e out again. Thanks again.