Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Catching errors in closing lexical filehandles

by Zaxo (Archbishop)
on Sep 27, 2004 at 05:43 UTC ( [id://394074]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    # use Fatal qw/open print close/;
    use Fatal qw/open close/;
    my $result = eval {
    ...
        print $fh "Foo\n" or die $!;
    };
    print $result ? $result : $@, $/;
    
  2. or download this
    Can't close(GLOB(0x804b548)): No space left on device at (eval 2) line
    + 3
        main::__ANON__('GLOB(0x804b548)') called at -e line 1
        eval {...} called at -e line 1
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (4)
As of 2024-06-24 23:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.