Message-Stack

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

SYNOPSIS

  my $stack = Message::Stack->new;

  $stack->add_to_messages(Message::Stack::Message->new(
      id        => 'something_happened',
      level     => 'error',
      scope     => 'login_form',
      subject   => 'username',
      text      => 'Something 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_message>.

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.

