Giving your code the once-over, I can imagine that
GetInfDataFiles is being called with no parameter, or a parameter that is
undef.
May I suggest inserting
unless ($path) {die "empty or no parameter passed to GetInfDataFiles!"
+}
As you say you're a total newbie, I'll point out that
unless is one of perl's cooler control structures; it's the complement to
if -- it tests for falseness, where if tests for truth. For this type of test using
if, you'd need to write
if (! $path) {die "empty or no parameter passed to GetInfDataFiles!"}
and I think the negation inside the if isn't too much clearer than the unless.
OK, so now that you know the unless will only execute when its fails, whenever your sub dies like this, you'll know that the
$code was blank.