Message-Stack

Message::Stack - Deal with a "stack" of messages

SYNOPSIS

$stack->add(Message::Stack::Message->new(
    id        => 'something_happened',
    level     => 'error',
    scope     => 'login_form',
    subject   => 'username',
    text      => 'Something happened!'
));
# Or... for those that want to type less
$stack->add({
    id        => 'something_else_happened',
    level     => 'error',
    scope     => 'login_form',
    subject   => 'password',
    text      => 'Something else happened!'
});

...
my $errors = $stack->get_messages_for_level($error);
# Or
my $login_form_errors = $stack->get_messges_for_scope('login_form');

DESCRIPTION

Message::Stack provides a mechanism for storing messages until they can be
consumed.  A stack is used to retain order of occurrence.  Each message may
have a level, scope, subject and text.  Consult the documentation for
L<Message::Stack::Message> for an explanation of these attributes.

This is not a logging mechanism.  The original use was to store various errors
or messages that occur during processing for later display in a web
application.  The messages are added via C<add>.

COPYRIGHT

Copyright (C) 2009 Cory G Watson

This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.

