in reply to find acronyms in a text

Please consider replacing
     die "cannot open the file";
with
     die "cannot open file '$file': $!\n";

This will enable you to see what file the user asked for, and why it couldn't be opened.

Obviously this isn't directly associated with you problem, or you would have seen your die. It is, however, a good habit to develop. (Just like use strict; use warnings;)

Replies are listed 'Best First'.
Re^2: find acronyms in a text
by arun_kom (Monk) on Jul 23, 2009 at 13:02 UTC
    good advice ... if you also want to see which line number your script died on, avoid placing \n after $! in the die statement.