Why does Test::Exception use this syntax rather than the one more familiar to Perl testers?
Because I think it reads more cleanly than having to type "sub" everywhere :-) There's a general rule in Perl that there isn't a comma after passing a block to a subroutine so I don't think that this should be completely unexpected.
Now, to make things even more annoying, Test::Exception reverts to a more familiar syntax for throws_ok -- but only partially so. In this function, a comma is required between the regex matching the thrown error message and the test description
Again, this is just another instance of the general rule in Perl that there isn't a comma following a block. Please complain to Larry :-)
We would recommend that an alternative interface be provided which more closely follows that established in Test::More. Such an interface would probably look like this:
This syntax already exists. Like all subroutines prototyped to take anonymous subroutines as the first argument you can do it explicitly by using () and sub {}. For example:
(6)
]
