pfenwick/autodie — pull request #12 by schwern (2012-06-19 21:51:43+00:00)
Title: Bug/open pragma

This fixes open and sysopen so they honor the open pragma.

There are some issues...

* Uses undocumented keys in the hint hash
* Does not work before 5.10 because you can't get at the hint hash
* Does not take into account the lexical leak guard wrapper

I had to go with binmode'ing the filehandle because I couldn't for the life of me get `open()` to honor `${^OPEN}`. [FC pointed out](https://rt.cpan.org/Ticket/Display.html?id=54777#txn-1091473) that it's just compile time magic for setting `%^H` and would require putting the `open` in an eval for it to see it. I opted for binmode rather than calling eval every time one opened a file.