Skip to content

Instantly share code, notes, and snippets.

@rgs
Created March 22, 2012 09:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rgs/2157330 to your computer and use it in GitHub Desktop.
Save rgs/2157330 to your computer and use it in GitHub Desktop.
A script to create word clouds from perl's core documentation
use strict;
use warnings;
use File::Slurp;
use Image::WordCloud;
for my $file (<perl*.pod>) {
my $text = `pod2text $file`;
my $wc = Image::WordCloud->new();
$wc->words($text);
my $gd = $wc->cloud();
$file =~ s/od$/ng/;
open my $fh, '>', $file or die;
print $fh $gd->png();
close $fh;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment