NAME
Acme::Can't - Determine whether your object can NOT call a given method.
SYNOPSIS
use Acme::Can't;
use Some::Module;
my $obj = Some::Module->new();
die "Can't do that!" if $obj->can't( 'live' );
DESCRIPTION
This module allows a programer to determine whether on not their objects have the ability to call a given method. This sort of test can be useful to programatically enforce interface implementation. This allows for much cleaner code than using unless and can.
USAGE
You can use the can't
method on any object you create, and just pass it a method name that you want to ensure that your object can not call. can't
returns 1 if true, 0 if false.
ACKNOWLEDGEMENTS
This module was almost wholly inspired by Christopher Nehren's Acme::Isn't, which was in turn inspired by Damian Conway's Acme::Don't.
AUTHOR
Kent Cowgill, <kent@c2group.net<gt>
COPYRIGHT AND LICENSE
Copyright (C) 2009 by Kent Cowgill
The author hereby releases this library into the public domain.
The author hereby disclaims all responsibility for any usage of this library in any code whatsoever. If you're silly enough to use this code, you deserve whatever you get. :-)