#!usr/bin/perl -w use DBI; use File::Copy; @files=; print "+---------------------------------------------+\n"; print "| Here are the list of files in the directory |\n"; print "+---------------------------------------------+\n\n"; foreach my $file (@files){ my @arr=split(/\//,$file); print "\n"; my @field=split(/%/,$arr[2]); print $arr[2]."\n\n..........................................................\n"; my @arr1=split(/\./,$field[3]); pop(@arr1); my $sec=pop(@arr1); my $min=pop(@arr1); my $hr=pop(@arr1); my $date_string=join('-',@arr1); my $sysacc=$field[0]; my $rid=$field[2]; my $jid=$field[1]; my $time=$hr.":".$min.":".$sec; #print "System:\t\t $sysacc \nreport id:\t$rid \njob id:\t\t$jid\ndate stamp:\t$date_string\ntime :\t\t$hr:$min:$sec \n"; #print "===============================================================\n"; my $oldloc=$file; $dbh = DBI->connect('dbi:ODBC:driver=microsoft access driver (*.mdb);dbq=C:\Documents and Settings\smanicka\Desktop\public_html\lookup_test.mdb') or die "Sorry,Cant connect\n $DBI::errstr \n"; my $query= "select * from lookup where Sys_Acc=\'$sysacc\' AND Job_name=\'$jid\' AND Report_name=\'$rid\'"; my $sth=$dbh->prepare($query); $sth->execute(); my $status=0; my @stash; while($arr_ref=$sth->fetchrow_array()){ #$status=1; push @stash,[@$array_ref]; } foreach $array_ref(@stash){ print "ROw: @$array_ref \n"; } #if($status==0){ #print " not found"; #} #else{ #print "found";} ## where Sys_Acc=\'$sysacc\'& Job_name=\'$jid\' & Report_name=\'$rid\' #$newloc="h:/newtest/$sysacc/$arr[2]"; #move($oldloc,$newloc)or die "fail to move"; }