use File::Copy; sub ucopy { @_ == 2 or die 'sub ucopy needs two arguments.'; -e $_[1] and (stat $_[1])[9] > (stat $_[0])[9] and return 1; copy @_; }