good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
The suggested File::Which is probably *the* solution you want. The suggested File::Spec is probably (very) good to get used to when writing code that should work on all types of OS's. I want to add that returning the actual path of the tool/program/script/file is a lot more useful than returning 1. I also want to say that your approach is less than perfect as you do not skip empty $PATH elements and elements that do not exist or are not a directory. This matters a lot if you are dealing with environments where the environment cannot be trusted. I'd suggest (ignoring both mentioned modules):
Enjoy, Have FUN! H.Merijn In reply to Re: Check for another program availability
by Tux
|
|