http://www.perlmonks.org?node_id=1016430


in reply to Why is the error thrown from close(FH) when the error is the missing <> on while(FH)?

How did you get that far:
Global symbol "$inline" requires explicit package name at 2.pl line 6. Global symbol "$inline" requires explicit package name at 2.pl line 7. Global symbol "@contexts" requires explicit package name at 2.pl line +7. Bareword "KNOWN_HOSTS" not allowed while "strict subs" in use at 2.pl +line 14. Execution of 2.pl aborted due to compilation errors.

Next, is it your understanding that a while loop conditional can only be the line input operator(<>)?

  • Comment on Re: Why is the error thrown from close(FH) when the error is the missing <> on while(FH)?
  • Download Code

Replies are listed 'Best First'.
Re^2: Why is the error thrown from close(FH) when the error is the missing <> on while(FH)?
by techgrrl (Sexton) on Feb 01, 2013 at 03:05 UTC

    Greetings

    It is a code fragment, not a full program.

    In order to actually create an executable script I would need to provide multiple files and quite a bit more code. I can do that if requested, but I was hoping that since the reason the error was thrown was given (the missing double diamond <> operator) that someone could look at this and help me understand why is was thrown from the close(FH) instead of the while(FH) where the error is.

    I don't think duplicating the error would tell you anything the sample does not already tell you, but I could be wrong I suppose.

    Cheers,

    TechGrrl