[ this is the same thing i posted in my reply to the same message
on comp.lang.perl.modules ]
In article <[EMAIL PROTECTED]>, John Clyman 
<[EMAIL PROTECTED]> wrote:

>     $error_messages = Messages->new({
>       bad_file_format  => 'File format not recognized!',
>       file_open_failed => sub{"Unable to open file $_[0]: $!"},
>       _default         => sub{"Unknown message " . shift() .
>                               " with params " . (join ",",@_)},
>     });
> 
>   # generate messages
>     print $error_messages->bad_file_format;
>     print $error_messages->file_open_failed('myfile');
>     print $error_messages->no_such_message;  # falls back to _default
> -end-

> I was originally thinking of calling this Text::MessageLibrary but thought
> that Text::Messages sounded cleaner. Any thoughts or suggestions?


i'm not sure this belongs in Text:: since it doesn't deal with text manipulation.
Maybe it belongs in Class.

whereever it ends up, the second level namespace should be singular, i.e.
Text::Message.

-- 
brian d foy (one of many PAUSE admins), http://pause.perl.org
please send all messages back to [EMAIL PROTECTED]

Reply via email to