Reported by Frédéric L. W. Meunier" <0@pervalidus.net>
# Don't ignore failures
set -e
-# Find perl. Not as good as autoconf would do, but good enough.
+# Find perl. Code based on Autoconf, but without non-POSIX support.
if test -z "$PERL"; then
- PERL="`which perl 2>/dev/null`"
+ save_IFS=$IFS
+ IFS=:
+ for dir in $PATH; do
+ IFS=$save_IFS
+ test -z "$dir" && dir=.
+ if test -x "$dir/perl"; then
+ PERL="$dir/perl"
+ break
+ fi
+ done
fi
-if test -z $PERL; then
+if test -z "$PERL"; then
echo "Cannot find perl" 2>&1
exit 1
fi