in reply to Some Weird Probelm

You're using strict, which is good. That means that you need to add declare your variables. Try
my $DICT_A = "/usr/perl/dict_a.txt"; my $DICT_N = "/usr/perl/dict_n.txt";
Also, your code to assemble $ranpwd isn't doing what you expect. The string concatenation operator in Perl is '.', not ','.