#!/usr/bin/perl -w use strict; my $file = shift || "/usr/share/dict/words"; use vars qw(@w @z @b); open (FH, "<$file") or die "Can't open $file: $!\n"; while () { chomp; if ($_ =~ /^w.+/i) { push @w, lc($_); } elsif ($_ =~ /^z.+/i) { push @z, lc($_); } elsif ($_ =~ /^b.+/i) { push @b, lc($_); } } die "Dictionary broken\n" if not defined @w or not defined @z or not defined @b; print $#w * $#z * $#b * $#w . " Permutationen!\n"; for (my $w1 = 0; $w1 < $#w; $w1++) { for (my $z1 = 0; $z1 < $#z; $z1++) { for (my $b1 = 0; $b1 < $#b; $b1++) { for (my $w2 = 0; $w2 < $#w; $w2++) { print $w[$w1]." ".$z[$z1]." ".$b[$b1]." ".$w[$w2]."\n"; } } } }