On Fri, Jul 01, 2005 at 07:26:16PM -0700, Michael G Schwern wrote: > It seems pretty clear to me that most warnings should not be supressed. > But what about uninit warnings, specificly? Is there any utility to > something like: > > like( $foo, qr/.../ ); > > and: > > cmp_ok( $foo, 'eq', $bar ); > > warning about $foo being undefined? Especially since the test diagnostics > will let you know about what was undef.
I'm not sure. For the specific example of cmp_ok with 'eq', then because the programmer has chosen that over is(), it seems fair that he/she made an explicit choice that $foo being undef was an acceptable match for $bar being an empty string. (Not so sure about the other 13 comparison operators) I think I'd prefer like to fail (distinct from warning) if $foo is undef, given that the expected regexp may well intentionally match an empty string. Nicholas Clark