Since you give no usage what so ever, i can only speculate just exactly what you want to output to look like. And more importantly, what the "rules" are. But i can say that you have a lot of needless code there. Try this instead:
And read The Dynamic Duo --or-- Holy Getopt::Long, Pod::UsageMan!use Data::Dumper; my (%symbol,@old,@new); my $max = 10; my $ws_replace = '_'; my $letters_only = 1; while (<DATA>) { chomp; push @old, $_; $_ = substr $_,0,10 if $max; s/\s+/$ws_replace/g if $ws_replace; s/\W+//g if $letters_only; $_ .= $. if $symbol{$_}++; push @new, $_; } print Dumper \@old, \@new; my %compare; @compare{@old} = @new; print Dumper \@compare; __DATA__ Line one Line two xxxxxxxxxxx Another line xxxxxxxxxxx Lines end here not xxxxxxxxxxx Fourth line (used to be) Line five Lines end here Lines end here too
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
In reply to Re: VarStructor II -- Abbreviation tool
by jeffa
in thread VarStructor II -- Abbreviation tool
by Wassercrats
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |