close $rh{$_} or die $! for keys %rh; #error: # Bad file descriptor at C:\Perl\scripts\test5.pl line 20.