Determine instant answer type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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