#!/usr/bin/perl -w open(CSV, "/tmp/doctime.txt"); @title = ; for ($i = 0; $i < scalar(@title); $i++) # a for loop has three fields. the first sets a counter ($i=0) { ($file[$i], $date[$i]) = split(",", $title[$i]); # split the line into its 2 arrays } for ($a = 0; $a < scalar(@file); $a++) { $access=$date[$a]; $filez = $file[$a]; $filez =~ s/\ /\\ /g; $filez =~ s/.\s$//; print "File name # $filez\n"; print "Previous date # $access\n"; utime $access, $access, "$filez" || die print "couldn not set utime for $filez\n"; }