Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: Catching errors in closing lexical filehandles

by gaal (Parson)
on Sep 27, 2004 at 05:53 UTC ( #394077=note: print w/replies, xml ) Need Help??


in reply to Re: Catching errors in closing lexical filehandles
in thread Catching errors in closing lexical filehandles

Hey, I didn't know about Fatal, cool. Unfortunately it seems broken on my system:
Cannot make a non-overridable builtin fatal at /usr/share/perl/5.8/Fat +al.pm line 108. BEGIN failed--compilation aborted at f.pl line 1.
I wonder, does this do anything different?
use Fatal qw/open close/; my $result = do { open my $fh, '>', '/dev/full'; print $fh "Foo\n"; }; print $result ? $result : $@, $/;
Also it's probably worth trying to put in an extra nonces value at the end of the block, like "37", just to disambiguate the value of print from some mysterious other factor.

Replies are listed 'Best First'.
Re^3: Catching errors in closing lexical filehandles
by Zaxo (Archbishop) on Sep 27, 2004 at 05:57 UTC

    Arrgh! I keep falling afoul of print not being overridable! Leave it off the import list. I'll correct the code above.

    After Compline,
    Zaxo

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://394077]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2020-05-31 04:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (173 votes). Check out past polls.

    Notices?