sub touch { open F, ">>$_[0]" or return undef; seek F, 0, 2; my $length = tell F; print F 'A'; truncate F, $length; close F; return 1; } # presuming that the utime() function used in File::Touch is broken on your system # otherwise it would just be: utime($a, $m, $file);