Where/when did you print Dumper($fd)? You say it is undef, but as i read, it must contain some data.FunkyMonk is right, it must read print Dumper(\%fd). Could you please put that just before the loop construct?
And if it's true that you used print Dumper($fd), it shows you didn't use strict; and you will have to face the inqusitors :-)