Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Ovid (2709)

  (email not shown publicly)
AOL IM: ovidperl (Add Buddy, Send Message)

Stuff with the Perl Foundation. A couple of patches in the Perl core. A few CPAN modules. That about sums it up.

Journal of Ovid (2709)

Thursday January 08, 2004
01:44 PM

Note for the day

[ #16714 ]

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.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • Since strict is often a synonym for good_taste, you have to say no good_taste; to use backwhacks as an alternate delimiter.

  • That's why I treat 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!