#!/usr/bin/perl

use strict;

my $f=shift;
my $x;

sub lffp {
	my $filename=shift;
	my $ret;
	foreach my $i (split(":",$ENV{PATH})) {
		if (-r $i."/".$filename and -f $i."/".$filename) {
			my $isave=$/;
			undef $/;
			open F,$i."/".$filename;
			$ret=<F>;
			close F;
			$/=$isave;
			last;
		}
	}
	return $ret;
}

$x=lffp($f);

print $x;
