in reply to How do I print a hash in perl

$stopwords is a hash reference, not just a hash. See perlreftut and perlref for information about how to work with references.
Sorry if my advice was wrong.