Using Your Own Base Class

package Your::Pirate::Ship;
use base 'Your::Pirate::Base';

sub dubloons {
    shift->error_msg( denied => 'dubloons' );

Error Thrown:

Walk the plank ye scurvy dog! There be no dubloons for ye!
Thus Spake Andy:

Now you can use Your::Pirate::Base as a base class for all your other pirate modules. Each of your modules will "inherit" the $MESSAGES definitions in the base class. They can also define their own additional (or different) $MESSAGES. Badger will Do The Right Thing™ to walk up the inheritance tree until it find the right error message.