Skip to content

Instantly share code, notes, and snippets.

@williamho
Created January 10, 2013 04:49
Show Gist options
  • Select an option

  • Save williamho/4499566 to your computer and use it in GitHub Desktop.

Select an option

Save williamho/4499566 to your computer and use it in GitHub Desktop.
hello pearl
#!/usr/bin/perl
@words = ('hi', 'hihi', 'hello', 'hi', 'hi', 'hihi');
%wordfreq = ();
foreach $w (@words) {
$wordfreq{$w} ++;
}
foreach $w (keys %wordfreq) {
print "$w appears $wordfreq{$w} times\n"
}
@williamho

Copy link
Copy Markdown
Author

way to spell 'perl' incorrectly in the description

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment