#!/usr/bin/env perl
# portable whereis script. pancake

$path=$ENV{"PATH"};
$bin=$ARGV[0];
if ($bin ne "")
{
	$found=0;
	foreach $dir (split(':',$path))
	{
	if ( -x "$dir/$bin" )
		{
		if (! $found )
			{
			print "$dir/$bin";
			$found=1;
			}
		}
	}
}
