in reply to Matching words based on letter content
#!/usr/bin/perl use strict; use warnings; my ($w, @w, %w); while (<DATA>) { chomp; @w = (0) x 26; $w[$_]++ for map -0x61 + ord lc, /[a-z]/ig; push @{$w{"@w"}}, $_; } print "@$w\n" while (undef, $w) = each %w; __DATA__ opt top pot pit stoop topos pit opt top pot stoop topos
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Matching words based on letter content
by wazoox (Prior) on Jan 28, 2005 at 16:54 UTC |