Dave Rolsky > Courriel-0.36 > Courriel::Part::Single

Download:
Courriel-0.36.tar.gz

Dependencies

Annotate this POD

Website

CPAN RT

New  1
Open  0
Stalled  1
View/Report Bugs
Module Version: 0.36   Source  

NAME ^

Courriel::Part::Single - A part which does not contain other parts, only content

VERSION ^

version 0.36

SYNOPSIS ^

  my $headers = $part->headers();
  my $ct = $part->content_type();

  my $content = $part->content();
  print ${$content};

DESCRIPTION ^

This class represents a single part that does not contain other parts, just content.

API ^

This class provides the following methods:

Courriel::Part::Single->new( ... )

This method creates a new part object. It accepts the following parameters:

You must pass a content or encoded_content value when creating a new part, but there's really no point in passing both.

It is strongly recommended that you pass a content parameter and letting this module do the encoding for you internally.

$part->content()

This returns returns the decoded content for the part. It will be in Perl's native utf-8 encoding, decoded from whatever character set the content is in.

$part->encoded_content()

This returns returns the encoded content for the part.

$part->mime_type()

Returns the mime type for this part.

$part->has_charset()

Return true if the part has a charset defined. Binary attachments will usually not have this defined.

$part->charset()

Returns the charset for this part.

$part->is_inline(), $part->is_attachment()

These methods return boolean values based on the part's content disposition.

$part->filename()

Returns the filename from the part's content disposition, if any.

$part->content_type()

Returns the Courriel::Header::ContentType object for this part.

$part->disposition()

Returns the Courriel::Header::Disposition object for this part.

$part->encoding()

Returns the encoding for the part.

$part->headers()

Returns the Courriel::Headers object for this part.

$part->is_multipart()

Returns false.

$part->container()

Returns the Courriel or Courriel::Part::Multipart object to which this part belongs, if any. This is set when the part is added to another object.

$part->content_ref()

This returns returns a reference to a scalar containing the decoded content for the part.

$part->encoded_content_ref()

This returns returns a reference to a scalar containing the encoded content for the part, without any decoding.

$part->as_string()

Returns the part as a string, along with its headers. Lines will be terminated with "\r\n".

$part->stream_to( output => $output )

This method will send the stringified part to the specified output. The output can be a subroutine reference, a filehandle, or an object with a print() method. The output may be sent as a single string, as a list of strings, or via multiple calls to the output.

See the as_string() method for documentation on the charset parameter.

ROLES ^

This class does the Courriel::Role::Part and Courriel::Role::Streams roles.

AUTHOR ^

Dave Rolsky <autarch@urth.org>

COPYRIGHT AND LICENSE ^

This software is Copyright (c) 2014 by Dave Rolsky.

This is free software, licensed under:

  The Artistic License 2.0 (GPL Compatible)
syntax highlighting: