#! /usr/bin/perl

# This basis of code taken from Andy Lester's
# Ack package.

use 5.010;
use strict;
use warnings;

my $stderr  = shift or die 'No stderr';
my $program = shift or die 'No program';

open(STDERR, '>', $stderr) or die "Can't redirect STDERR to $stderr: $!";

$0 = $program;
my $rc = do $program;
die "$program fails with return code $rc" if $rc;
die $@ if $@;
die "Couldn't run $program: $!"; # Ack doesn't return, it calls exit
