logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Courriel::Header - A single header's name and value

Api

       This class supports the following methods:

Author

       Dave Rolsky <autarch@urth.org>

Courriel::Header->New( ... )

       This method requires two attributes, "name" and "value". Both must be strings. The "name" cannot be
       empty, but the "value" can.

   $header->name()
       The header name as passed to the constructor.

   $header->value()
       The header value as passed to the constructor.

   $header->as_string(charset=>$charset)
       Returns the header name and value with any necessary MIME encoding and folding.

       The "charset" parameter specifies what character set to use for MIME-encoding non-ASCII values. This
       defaults to "utf8". The charset name must be one recognized by the Encode module.

   $header->stream_to(output=>$output,charset=>...)
       This method will send the stringified header 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.

Description

       This class represents a single header, which consists of a name and value.

Name

       Courriel::Header - A single header's name and value

Roles

       This class does the "Courriel::Role::Streams" role.

Source

       The source code repository for Courriel can be found at <https://github.com/houseabsolute/Courriel>.

Support

       Bugs may be submitted at <https://github.com/houseabsolute/Courriel/issues>.

       I am also usually active on IRC as 'autarch' on "irc://irc.perl.org".

Synopsis

         my $subject = $headers->get('subject');
         print $subject->value;

Version

       version 0.49

See Also