in reply to Re: checking bareword-filehandle
in thread checking bareword-filehandle

eval only traps errors, not warnings.
no warnings 'unopened';

Inside a small block should work though. See perllexwarn.

Replies are listed 'Best First'.
Re^3: checking bareword-filehandle
by morgon (Priest) on Aug 06, 2012 at 14:15 UTC
    seems not to work in my old Perl (5.8.8):
    use strict; use warnings; no warnings qw(unopened); open HUBBA, "/hubba"; print HUBBA "hubba";
    Produces a warning "print() on closed filehandle HUBBA at t line 6."

    Guess I have to disable all warnings...