in reply to Inherent 'which' command for perl

Something like this should work on most *nix platforms
use List::Util 'first'; use File::Spec::Functions 'catfile'; sub which { my $path = first { -x } map { catfile $_ => $_[0] } split ':' => $ENV{PATH}; return $path || "$_ not found in $ENV{PATH}"; } print "path to $_ is: ", which($_), "\n" for qw/ find perl here /; __output__ path to find is: /usr/bin/find path to perl is: /usr/bin/perl path to here is: here not found in /usr/kerberos/bin:/usr/local/bin:/u +sr/bin:/bin:/usr/X11R6/bin
HTH

_________
broquaint