#!/bin/sh

#
# Simple script to find perl and run it
#

# Avoid common problems with ENV (though perl shouldn't let it through)
# (can you believe some shells don't have an unset???)
unset ENV

x=x
[ -x /bin/sh ] 2> /dev/null || x=f

IFS=:$IFS
perl=
for i in $PATH; do
    [ X"$i" = X ] && i=.
    [ -$x "$i/perl" ] && perl=$i/perl && break 2
done

[ X"$perl" = X ] && {
	echo "$0: can't find perl - bye\n" 1>&2
	exit 1
    }

unset IFS
exec $perl "$@"
