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

autodie support #46

Open
abraxxa opened this issue May 20, 2016 · 2 comments
Open

autodie support #46

abraxxa opened this issue May 20, 2016 · 2 comments

Comments

@abraxxa
Copy link

abraxxa commented May 20, 2016

Creating an OO module for interfacing with Perl's, let's say suboptimal approach of swallowing failures which should be thrown as exceptions, would have been the perfect solution of fixing those in a backcompat way.
Sadly Path::Class still returns undef on several methods instead of throwing exceptions.
Naively I thought that using autodie changes this behaviour which is doesn't.
Do you see a way of changing Path::Class' behaviour, lexically scoped so it doesn't break other modules, to either do so when autodie is used or by e.g. an import parameter?

@kenahoo
Copy link
Owner

kenahoo commented May 20, 2016

Yes, I think that could be achieved. Which methods in particular did you mean? The most common cases are handled by openr and openw - the idea being that it should be easier to do things the right way than the wrong way. But I'm sure there are other places that might usefully throw exceptions.

@abraxxa
Copy link
Author

abraxxa commented May 23, 2016

I use Path::Class::Dir->open to check if a directory exists and also Path::Class::File->open( O_CREAT | O_WRONLY | O_EXCL ) in ExtJS::Generator::DBIC::Model.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants