my $max_len = 20000; # #Load Filenames into Scalar # opendir(DIR, "/RAWdata") || die "Cannot open gif:$!\n"; my @filenames = grep !/^\./, readdir(DIR); close(DIR); my $file; # #Go through list of filenames in a directory #Add the name, length, and binary data to the table # foreach my $title (@filenames) { open(FILE, "/RAWdata/$title") || die "Cannot open $title : $!\n"; binmode FILE; my $file_len = read FILE, $file, $max_len; #Prepare Insert Statement my $sth = $dbh->prepare("INSERT into RAH values (?,?,?)" ); #Bind Variables to columns. $sth->bind_param(1,$title); $sth->bind_param(2,$file_len); $sth->bind_param(3,$file, {ora_type => ORA_RAW} ); #Insert. my $rv = $sth->execute(); close(FILE); }