Skip to content

Instantly share code, notes, and snippets.

@dblevins
Created July 9, 2009 22:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dblevins/144068 to your computer and use it in GitHub Desktop.
Save dblevins/144068 to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl
sub which {
my $cmd = shift;
if (eval "require File::Which; 1") {
return File::Which::which($cmd);
} else {
return `which $cmd`;
}
}
print "pbcopy is available\n" if which("pbcopy");
print "xclip is available\n" if which("xclip");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment