gudn tach!
Wenn man Zeit hat, fällt einem schon so einiges ein. [...]
wie wahr, wie wahr.
http://selfhtml.apsel-mv.de/java-javascript/?modus=all&last=37
#!/usr/bin/perl
use strict;
use warnings;
use File::Slurp qw(slurp);
die "error: missing param: filename of large text file. \n" unless defined $ARGV[0];
my $filename = $ARGV[0];
my $filecontent = slurp $filename;
my @words = sort keys {map {$_=>1} $filecontent=~/\b\p{L}++/g};
my @grp = (shift @words);
for my $w(@words, ''){
if(substr($w, 0, 3) eq substr($grp[0], 0, 3)){
push @grp, $w;
}else{
print "@grp\n" if @grp>1;
@grp = ($w);
}
}
prost
seth