Messages Are Flexible

use Your::Point;

$Your::Point::MESSAGES->{ missing } 
    = "Avast!  You be missin' ye old '%s' value.  Arrrr!";

my $point = Your::Point->new( x => 10 );

Error Thrown:

point error - Avast! You be missin' ye old 'y' value. Arrrr!
Thus Spake Andy:

Putting all your messages in one place is a good idea if you want to be able to customise messages at a later date, e.g. to generate HTML messages, localise your application, or when it's "Talk Like a Pirate" day. This example shows us poking a new message format into the $MESSAGES hash.