Skip to content

Instantly share code, notes, and snippets.

@killerfish
Created October 22, 2014 09:17
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save killerfish/bc55059c3e82cba49405 to your computer and use it in GitHub Desktop.
Determine instant answer type
sub get_ia_type {
my $path = "./lib/DDG/";
my %dirs = (
Fathead => "0",
Goodie => "1",
Longtail => "0",
Spice => "1"
);
while (my ($type, $bool) = each (%dirs)) {
if (-d $path . $type) {
return $type if ($bool > 0);
print "[ERROR] Sorry, DuckPAN does not support $type yet!";
exit -1;
}
}
print "[ERROR] No lib/DDG/Goodie, or lib/DDG/Spice found.";
exit -1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment