On Sep 24, 2:48 am, [EMAIL PROTECTED] (kapil.V) wrote: > Hi, > I used the code: > sub set_min{ > > $host = shift; > $date = shift;
Here you set $host and $date to be two parameters passed into your set_min function. > print "The host is $host and the date is $date\nIn the function > set_min\n"; > $host = SOX::get_db_host(); > $user = SOX::get_db_user(); Then here, you override those variables, setting them instead to be the return values of your SOX::get_db_host and SOX::get_db_user functions. > $passwd = SOX::get_db_passwd(); > > $db = DBI-> connect ( $host, $user, $passwd, {'AutoCommit' => 0, > 'PrintError' => (not $debug), 'RaiseError' => $debug } ); > my $insert_query = qq{ > UPDATE hosts SET last_checked = '$date' WHERE hostname = > '$host'; > }; Now your query is using both of these values. When you do: print "Query: <<$insert_query>>\n"; here, does that query print out what you expect it to? > The code runs without any warnings/errors, but the database is not touched. > What is wrong? You tell us. . . . Paul Lalli -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/