in reply to
Re^2: Error: Use of uninitialized value $item in concatenation (.) or string at...
in thread Error: Use of uninitialized value $item in concatenation (.) or string at...
You might find Data::Dumper helpful. Try adding the following to the end of your script:
use Data::Dumper; # you could put this at start of script
This will print your data structure in a fairly easy to understand format (see the documentation for details). It might help you to find and understand what is undefined.