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.