#!/afs/athena/contrib/perl5/p -w

use strict;
use FileHandle;

my $gnu_exec = '/afs/athena/project/gnu/bin/';
my $logfile = '/mit/olcdev/highlander/RCS-OPS';

$0 =~ s@.*/@@g;   $0 =~ s@\.pl$@@;

my $fh = new FileHandle ">>$logfile" || die "Can't open $logfile: $!";
print $fh "$0 @ARGV\n";
close $fh || die "Can't close $logfile: $!";

# exit 0 unless ($0 eq 'grlog');

# with '-w', perl whines about statements after exec()
{ exec($gnu_exec . $0, @ARGV); }

my $err = $!;
my $fh = new FileHandle ">>$logfile" || die "Can't open $logfile: $!";
print $fh "EXEC FAILED: $err\n";
close $fh || die "Can't close $logfile: $!";
