Ricardo SIGNES 😄
and 1 contributors


Data::Message - parse and build header-and-body messages (kinda like email)


version 1.104


  use Data::Message;
  my $message = Data::Message->new(join('',<>), fold => 1);
  print $message->header("Customer-ID");
  print $message->body;


ACHTUNG! What's the point of this module? It isn't even clear to me, the current maintainer. Consider using Email::Simple or Email::MIME directly.

This module is a generic interface to dealing with RFC2822 compliant messages. Email is the most common example of messages in this format, but not the only one. HTTP requests and responses are also sent and received in this format. Many other systems rely on storing or sending information with a header of key/value pairs followed by an optional body.

Because Email::Simple is so good at parsing this format, and so fast, this module inherits from it. Changes to the interface are only prevelant in options provided to the constructor new(). For any other interface usage documentation, please see Email::Simple.

Because Data::Message is a subclass of Email::Simple, its mixins will work with this package. For example, you may use Email::Simple::Creator to aid in the creation of Data::Message objects from scratch.


  my $message = Data::Message->new(join( '', <> ));

The first argument is a scalar value containing the text of the payload to be parsed. Subsequent arguments are passed as key/value pairs.


Email::Simple, Email::Simple::Creator, Email::Simple::Headers, perl.


  • Casey West

  • Ricardo SIGNES <rjbs@cpan.org>


This software is copyright (c) 2004 by Casey West.

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