I don't know which value is the unitialized one (mostly because you haven't shown any code besides the subroutine to give context), but I can give you a good clue as to how to find out.
Simply print out the variables for the line where the error is occurring. If it's the last one, try something like:
printf "TFD> count is '%s'\n", $count; printf "TFD> path[count] is '%s'\n", $::path[$count]; printf "TFD> direntry[count] is '%s'\n", $::direntry[$count]; printf "TFD> FileLabel is '%s'\n", $::FileLabel; printf "TFD> DirLabel is '%s'\n", $::DirLabel;
For something like treeref which is more than a mere scalar value, you can use the module Data::Dumper, which is invaluable in these situations:
use Data::Dumper; printf "TFD> treeref => '%s'\n", Dumper(\$treeref);
That should tell you pretty quickly if you have an undefined value, and exactly which it is.
Update: I should have mentioned that I use the string "TFD" to mean "Temporary - for debug". It's an easy way to add debugging information that can later be searched for and removed.
In reply to Re: uninitialised value in hash reference
by liverpole
in thread uninitialised value in hash reference
by Maze
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |