9 my @dirs = grep { /^\// && -d } split(/:/, $ENV{PATH
}), qw(
21 my %path = map { $_ => locate
($_, @dirs) } @ARGV;
27 foreach my $tool (keys %path) {
28 next if not defined $path{$tool};
29 print "$tool $path{$tool}\n";
31 unlink "bin.sys/$tool";
32 symlink $path{$tool}, "bin.sys/$tool"
33 or warn "bin.sys/$tool -> $path{$tool}: $!\n";
37 my ($tool, @dirs) = @_;
39 # use die to break out of the find as soon
45 return $File::Find
::prune
= 1 unless -r
-x
-r
;
46 return unless $tool eq $_ and -x
and -f _
;
47 die { found
=> $File::Find
::name
};
54 return (ref $@
eq ref {} and $@
->{found
}) ?
$@
->{found
} : undef;