#!/bin/sh
PERL=perl

if test `echo -n test | wc -c` -eq 4
then F='-n'
E=
else F=
E='\c'
fi

TESTPERL=$PERL
while true
do
	type $PERL 2&> /dev/null
	if [ $? != 0 ]
	then
		echo
		echo "I need to know where the Perl interpreter resides."
		echo "It was not '$TESTPERL', or it was not in your"
		echo "path.  Please enter a fully-qualified path name,"
		echo "or just press RETURN to exit."
		# echo "(or just press ENTER to exit -- what did I say?)"
		echo
		echo $F "Where is your Perl 5, please? $E"
		read PERL
		if test $PERL
		then TESTPERL=$PERL
			 continue
		else exit 1
		fi
	fi
	set `type $PERL`
	PERL=$3
	if [ $? -eq 0 ]
	then
		echo "Found Perl as $PERL"
		break
	else
		echo "Perl version not high enough."
		TESTPERL=$PERL
		PERL=whatchahoozix
	fi
done
$PERL ./install.pl $PERL

