$LIST_FILE="listfile2"; open(LISTFILE, "$LIST_FILE") or die "Can't open the file.\n"; while() { $FILE=$_; # Let's do it print "Importing $FILE.\n"; system("mysql < $FILE"); print "Sleeping for 5.\n"; system('sleep 5'); }