Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: checking bareword-filehandle

by moritz (Cardinal)
on Aug 06, 2012 at 13:20 UTC ( #985704=note: print w/replies, xml ) Need Help??


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 (Curate) 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...

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://985704]
help
Chatterbox?
[LanX]: does it include hidden Perl 6 messages or other satanism?
[zentara]: I'm listening to 20,000 Tibetan monks chant Om Mani Padme Hum
[zentara]: I've decided the first words I will utter when I'm born into that other world..... Hari Om :-)

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (12)
As of 2017-05-24 21:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?