NAME

GT::Mail::Encoder - MIME Encoder


SYNOPSIS

        open IN, 'decoded.txt' or die $!;
        open OUT, '>encoded.txt' or die $!;
        if (GT::Mail::Encoder->supported ('7bit')) {
            GT::Mail::Encoder->decode (
                                    debug    => 1,
                                    encoding => '7bit',
                                    in       => \*IN,
                                    out      => sub { print OUT $_[0] }
                                ) or die $GT::Mail::Encoder::error;
        }
        else {
            die "Unsupported encoding";
        }
        close IN;
        close OUT;


DESCRIPTION

GT::Mail::Encoder is a MIME Encoder implemented in perl. It will try to use the C extension for encoding Base64. If the extension is not there it will do it in perl (slow!).

Encoding a stream

The new() constructor and the supported() class method are the only methods that are public in the interface. The new() constructor takes a hash of params. The supported() method takes a single string, the name of the encoding you want to encode and returns true if the encoding is supported and false otherwise.

debug
Set debugging level. 1 or 0.

encoding
Sets the encoding used to encode.

in
Set to a file handle or IO handle.

out
Set to a code reference, the decoded stream will be passed in at the first argument for each chunk encoded.


COPYRIGHT

Copyright (c) 2004 Gossamer Threads Inc. All Rights Reserved. http://www.gossamer-threads.com/


VERSION

Revision: $Id: Encoder.pm,v 1.40 2004/01/13 01:35:17 jagerman Exp $