Skip Menu |

This queue is for tickets about the Carp-Assert-More CPAN distribution.

Report information
The Basics
Id: 28444
Status: resolved
Priority: 0/
Queue: Carp-Assert-More

People
Owner: Nobody in particular
Requestors: notbenh [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: would love to see assert_undefined
With everything that C:A:More offers I would love to see a assert_undefined. I can't think of an easy to fake it with the current assert_defined. Heres a quickie example of how I would use this: eval { $data = XMLin($file); }; assert_undefined($@, q{not proper XML}); my guess is that it would just be a basic copy of the current assert_defined: =head2 assert_undefined( $this [, $name] ) Asserts that I<$this> is not defined. =cut sub assert_undefined($;$) { return unless defined( $_[0] ); require Carp; &Carp::confess( _fail_msg($_[1]) ); } Thanks so much. -- benh~
Added in 1.14