Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throw exceptions on implicit close. #22

Open
schwern opened this issue Oct 20, 2015 · 0 comments
Open

Throw exceptions on implicit close. #22

schwern opened this issue Oct 20, 2015 · 0 comments

Comments

@schwern
Copy link
Contributor

schwern commented Oct 20, 2015

Throw an exception if an implicit close fails. For example.

use feature 'exceptions';
{
    open my $fh, "|-", 'false';
} # $fh is implicitly closed

The code is in do_close. Remove the exception from pp_close.

schwern added a commit that referenced this issue Oct 24, 2015
Caveats:

Implicit close on block exit does not throw an exception. #22

close() will warn in some cases, like passing it something that isn't
a filehandle. This is redundant and should be turned off with exceptions.

Sometimes open() will die in sv_2io() with a string. This will be
fixed by #20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant