#!/usr/bin/env perl use File::Find; find({ wanted => \&process, }, split /:/, $ENV{'PATH'}); sub process { -f && -x && $ARGV[0] eq $_ && print $File::Find::name, "\n"; }