in reply to Bad file descriptor error

Maybe you want to improve your error message to also output the offending line, instead of only outputting the number of the offending line?

die "Unknown format in file '$file' line $. : [$_]";

Replies are listed 'Best First'.
Re^2: Bad file descriptor error
by zing (Beadle) on Sep 05, 2012 at 08:24 UTC
    Sorry for that,but this is the only error Im getting :-
    Unknown format list.txt. Bad file descriptor at code.pl line 30, <$fh> + line 41.
      And what is on the line 41 of list.txt? An empty line?
      لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
        Christ!!!! yes that was it. Thanks a lot to you all. God bless.

      So, have you looked at line 30?

      What have you done to improve the error message that line 30 produces?

      Maybe consider reading die to find out what that subroutine does.