#!/usr/bin/env perl use strict; use warnings; use LWP::Simple; use HTML::TableExtract; my $html = get( 'http://en.wikipedia.org/wiki/Kool-Aid' ); my $te = HTML::TableExtract->new( depth => 0, count => 1 ); $te->parse($html); #my @flavors; my %flavors; for my $ts ($te->tables) { #push @flavors, split( /\s*,\s*/, $_->[1] ) for $ts->rows; for ($ts->rows) { $flavors{$_}++ for split( /\s*,\s*/, $_->[1] ); } } #print $_,$/ for @flavors; print $_,$/ for sort keys %flavors;