Created
July 21, 2012 06:44
-
-
Save lukec/3154886 to your computer and use it in GitHub Desktop.
perl oneliner to find the population of a city.
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
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