Skip to content

Instantly share code, notes, and snippets.

@edipretoro
Forked from rgs/perldoc-wordcloud.pl
Created March 25, 2012 15:25
Show Gist options
  • Select an option

  • Save edipretoro/2197311 to your computer and use it in GitHub Desktop.

Select an option

Save edipretoro/2197311 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