Skip to content

Instantly share code, notes, and snippets.

@lukec
Created July 21, 2012 06:44
Show Gist options
  • Save lukec/3154886 to your computer and use it in GitHub Desktop.
Save lukec/3154886 to your computer and use it in GitHub Desktop.
perl oneliner to find the population of a city.
cpanm WWW::Wikipedia;perl -le '$t=qx(wikipedia "$ARGV[0]");chomp$t;if($t=~s/.+can refer to.+?\n\n//){map{$c=qx(wikipedia "$_");if($c=~/population_total = ([\d,]+)/){print"$_ $1\n"}}split/\*|\n/,$t}' hartsville
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment