Test-More / TB2

Test::Builder version 2, the next generation of building testing modules in Perl
Other
1 stars 0 forks source link

Protect against polluting $! or $@ with open() #204

Closed schwernbot closed 10 years ago

schwernbot commented 10 years ago

From: @schwern Date: Friday Mar 30, 2012 at 13:02 GMT Orig: https://github.com/Test-More/test-more/issues/268

Any call to open risks setting $!. This can innocently affect tests, such as autodie (see #266).

Rather than localize $! everywhere open is used, write a role to provide an open method which does this. See TB2::CanTry for a similar example.