Skip to content

Instantly share code, notes, and snippets.

@tobyink
Last active August 29, 2015 13:56
Show Gist options
  • Select an option

  • Save tobyink/8820443 to your computer and use it in GitHub Desktop.

Select an option

Save tobyink/8820443 to your computer and use it in GitHub Desktop.
use strict;
use warnings;
use File::Spec;
my @candidates = (
File::Spec->catfile('/', 'usr', 'bin', 'zip'),
File::Spec->catfile('/', 'usr', 'local', 'bin', 'zip'),
File::Spec->catfile('C:', 'bin', 'zip'), # for Windows
);
my ($found) = grep -f, @candidates;
print "Found it at '$found'!\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment