in reply to Is it possible to "use vars" or "our" a file handle?

If you still want to use bareword filehandles, there are several options. First of all, whenever Perl gives a warning when the code is correct, you have the option to disable the warning. IMO, that's preferred over any code changes you make just to make 'use warnings' happy. Disabling the warning is clear sign to whomever later has to deal with the code that you've judged the warning, and (s)he isn't left with WTF code. Second, you can just mention the variable twice ;-). For instance, by duplicating the line. Or printing the empty string to the handle.
  • Comment on Re: Is it possible to "use vars" or "our" a file handle?

Replies are listed 'Best First'.
Re^2: Is it possible to "use vars" or "our" a file handle?
by almut (Canon) on Nov 02, 2009 at 16:50 UTC
    ... For instance, by duplicating the line. Or printing the empty string to the handle.

    Or just

    *MESSAGES;

    (which doesn't seem to emit a "Useless use of ... in void context" warning, or similar...)