I've been seeing a lot of test code that looks like this:
{ no strict; local *Foo::Bar::baz = sub { die "another day" }; throws_ok {$foo->baz} qr\another day\, 'simple error thrown'; }
When overriding a subroutine that is explicitly named, there is no need to turn off strict.
Since strict is often a synonym for good_taste, you have to say no good_taste; to use backwhacks as an alternate delimiter.
Re:Ah, but there is!
Ovid on 2004-01-08T20:42:20
Heh
:) I tossed those in there on the spur of the moment. I thought it was fun.
strict
almost as a unit test. I write the code that I think will cause strict
to complain, run it, and then, only when strict
complains, I put it in its own block and put in a no strict
. I've learned a lot about what strict
does and doesn't allow this way!