use constant MIN_FILES => "C:/*.min"; touch_files( MIN_FILES ); sub touch_files { # The touch_files subroutine accepts a single # parameter which is passed to the glob() function. # All files matched by the file specification are # noted as having been "touched" or updated. This # routine does not actually alter the files so the # contents are not altered. # Get the filenames to search for from the # parameter list. my $filenames = shift; # Get the current timestamp. All files will be stamped # with this time. my $now = time; # Loop once for each file. See [perldoc] on glob() # to see what is acceptable input. for my $touch_file ( glob $filenames ) { # Update the mtime/atime values and don't bother # actually opening the file. This function (like # all the others) is documented in [perlfunc]. utime $now, $now, $touch_file; } }