Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- %szatan;
- open(PLIK, "<tekst.txt");
- while($line=<PLIK>)
- {
- @tb=split(/[\s+,.\(\)\[\]]/ , $line);
- foreach $zm(@tb)
- {
- $szatan{$zm}=0;
- }
- foreach $zm(@tb)
- {
- $szatan{$zm}=$szatan{$zm}+1;
- }
- }
- close(PLIK);
- foreach $value (sort {$szatan{$b} cmp $szatan{$a} }
- keys %szatan)
- {
- print "$value $szatan{$value}\n"
- }
Advertisement
Add Comment
Please, Sign In to add comment