Skip to content

Instantly share code, notes, and snippets.

@mersanuzun
Created December 2, 2016 12:01
Show Gist options
  • Save mersanuzun/256964be910a77fccf0339e77b701fce to your computer and use it in GitHub Desktop.
Save mersanuzun/256964be910a77fccf0339e77b701fce to your computer and use it in GitHub Desktop.
my ($type, $search_term) = @ARGV;
$file = 'parsed_tax_name.txt';
sub get_tax_id_or_name{
open(FILE, "<$file") or
die("Could not open log file. $!\n");
while(<FILE>) {
if ($type eq "-t" and $_ =~ /$search_term\|(.*)/){
return $1;
}elsif ($type eq "-n" and $_ =~ /(\d*)\|$search_term.*/){
return $1;
}
}
}
print get_tax_id_or_name() , "\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment