#!/bin/sh
# -*- perl -*-
# This code allows us to start perl from our path or an environment variable
# rather than hardcoding a path into the #! line.  It works from sh or csh.
(exit $?0) && eval 'exec ${QPERLQ-perl} -x $0 ${1+"$@"}'
if (! $?QPERLQ) setenv QPERLQ perl
exec $QPERLQ -x $0 $argv:q

#!/usr/local/bin/perl -w
#
# $Id: cpdate,v 1.3 1998/05/10 14:29:51 ejb Exp $
# $Source: /home/ejb/scripts/RCS/cpdate,v $
# $Author: ejb $
#


$whoami = ($0 =~ m,([^/]*)$,) ? $1 : $0;

&usage if (scalar(@ARGV) != 2);

($srcfile, $destfile) = (@ARGV);

@stat = stat($srcfile);
($atime, $mtime) = @stat[8,9];
(utime $atime, $mtime, $destfile) ||
    warn "$whoami: utime $atime $mtime $destfile failed: $!\n";

sub usage {
    print STDERR "Usage: $whoami srcfile destfile\n";
    print STDERR "  Sets access and modification times of destfile " .
	"to those of srcfile.\n";
    exit 1;
}
