in reply to null output on hashes

L~R's suggestions are a good place to start, though there might be some issues, like he doesn't concatenate values from the two files (as you try to do), and there might be some unexpected results if a given "key" string occurs two or more times in one file but not at all in the other file(s).

As for the code you posted, you're working too hard on things that don't need work, and you've made some wrong assumptions about error checking. In particular:

Note that when you redirect STDOUT to a file on the command line, the stuff you print to STDERR will still show up on the terminal (and won't go into the file), which is usually just what you want. If you need to save the warning and error messages in a separate file, some shells (e.g. bash and other "Bourne" variants) let you do this on the command line:

perl_script infile.a infile.b > outfile 2> script.errs
Or you can just  open(STDERR,">script.errs"); at the start of your perl script.