in reply to spaces in filenames

I realise some of my perl was not as technically correct as it could have been. With some help from this thread though all is now working. Several issues lead to this 1> utime in windows will only change dates to files you own (even if you have write access). This is the same in unix but given root owns everything root will do them all. Unix does not like spaces, fair enough put "" around the word. This does not work with utime if you use it like this:
$oldtime = 1043205456; $filename = /share/shared/path/somepath/doc with space.doc; utime ($oldtime, $oldtime, "$filename");
but it will work like this
chdir("/share/shared/path/somepath"); $filename = doc with space.doc; utime ($oldtime, $oldtime, "$filename");
So finally this is the perl for setting a bunch of docs with spaces as root in unix.
#!/usr/bin/perl -w open(CSV, "/tmp/doctime.txt"); #contains comma seperated path,filename +,olddate @title = <CSV>; # I know this is lame but it works and I understand it for ($i = 0; $i < scalar(@title); $i++) { # some of you dont like this but it works fine ($dironly[$i], $filename[$i], $date[$i]) = split(",", $title[$i]); + } for ($a = 0; $a < scalar(@filename); $a++) { $access= $date[$a]; $file = $filename[$a]; $dir = $dironly[$a]; chdir("$dir"); print "$dir $file $access\n"; #use this for a log print utime ($access, $access, "$file"), "\n"; }
this is a snippet from the file it reads the values from
/staff/cy/share/shard/cr,MS_CR_New diensions server.xls,1020001208 /staff/cy/share/shard/cr,MS_CR_keon route modification 180902.xls,1044 +234302 /staff/cy/share/shard/cr,MS_CR Key route addition001.xls,1044234302 /staff/cy/share/shard/cr,CY_CR_Memory upgrade.doc,1034234102
Results mean more than tidy code <G> (still tidy code would be nice). Three scripts, one to record all dates, one to change the document properties of office docs, one to set the dates back (as the second script makes all file dates the present).