This is a Perl implementation of the kshwhence builtin, similar to cshwhich or bashtype -p. It differs from these in two ways: (1) it finds all occurrences of its arguments on PATH rather than just the first and (2) it treats its arguments as patterns, such that Whence cat* will return all commands that start with cat rather than looking for a literal 'cat*'.