http://qs1969.pair.com?node_id=782638


in reply to find acronyms in a text

This should work for text files.
#!/usr/bin/perl -w use strict; my %acronyms_captured; my $file = 'test.txt'; open FH, "<", $file or die; while(<FH>){ my @words = $_ =~ m/\b[A-Z]+\b/g; foreach(@words) { $acronyms_captured{$_} = undef; } } close(FH); foreach(keys(%acronyms_captured)){ print "$_\n"; }