#!/usr/bin/perl -w use strict; use vars qw($SOURCEFILE); $SOURCEFILE="/tmp/overwrite"; # Now walk the directory and replace the files. opendir(D,".") or die "opendir error: $!\n"; while (my $f = readdir(D)) { next if ($f =~ /^\./); next unless (-f $f); unlink($f) or die "Error unlinking '$f': $!\n"; link($SOURCEFILE,$f) or die "Error linking '$f': $!\n"; } closedir(D) or warn "closedir error: $!\n"; exit(0);