#!/usr/local/bin/perl -w use Msql; package main; $current_time = time(); $current_time = $current_time - 3600; print("The current time is: $current_time\n\n"); # $numargs = @ARGV; $database = "icdcal"; # database to connect to $table = "events"; # table to query if ($dbh = Msql->Connect("","$database")) { print("connected to database\n"); print("The database handle is: $dbh\n"); } $sth = ListFields $dbh $table; print("The statement handle is: $sth\n"); $socket = $dbh->sock; $dbase = $dbh->database; print("The socket is: $socket\n"); print ("The database is: $dbase\n"); @arr = ListTables $dbh; foreach $tables (@arr) { print ("Table Names: $tables\n"); } $sql = "delete from events where event_end_date < $current_time"; $dbh->query($sql) or test_error(0,$sql); # free up the memory associated with our connection to msql undef ($dbh); if (undef ($dbh)) { print("disconnected successfully from database\n"); }