Mail::M...d::Fast(3)

πŸ’– Mail::M...d::Fast(3) β€” User Contributed Perl Documentation πŸ’–

okay bestie, welcome to Mail::M...d::Fast, aka one line of a message header ✨ the manual page is literally titled that, and yes, it's giving "small module, big feelings." no cap.


πŸŽ€ NAME πŸŽ€

Mail::Message::Field::Fast β€” one line of a message header 🌸


🌈 INHERITANCE 🌈

Mail::Message::Field::Fast
  is a Mail::Message::Field
  is a Mail::Reporter

so it's in the family tree, it's got ancestors, it's got lore πŸ’…


✨ SYNOPSIS ✨

See Mail::Message::Field

that's it. that's the synopsis. go read your other bestie's page, iykyk 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so. this is the faster, but less flexible implementation of a header field. the data lives in an array, and some hacks were made to speed things up πŸ”₯ like, actual hacks, don't look too closely. be gentle with me bestie, and consider that every single message contains many of these lines, so speed is literally the whole point here. it's giving main character energy in the performance department.

Extends "DESCRIPTION" in Mail::Message::Field.


πŸ’… OVERLOADED πŸ’…

Extends "OVERLOADED" in Mail::Message::Field.

  • overload: '""' stringification β€” Inherited, see "OVERLOADED" in Mail::Message::Field ✨
  • overload: '0+' numification β€” Inherited, see "OVERLOADED" in Mail::Message::Field ✨
  • overload: '<='> numeric comparison β€” Inherited, see "OVERLOADED" in Mail::Message::Field ✨
  • overload: bool boolean β€” Inherited, see "OVERLOADED" in Mail::Message::Field ✨
  • overload: cmp string comparison β€” Inherited, see "OVERLOADED" in Mail::Message::Field ✨

🌟 METHODS 🌟

Extends "METHODS" in Mail::Message::Field.


🧚 Constructors 🧚

Extends "Constructors" in Mail::Message::Field.

  • $obj->clone() β€” Inherited, see "Constructors" in Mail::Message::Field πŸ’«
  • $class->new(($line | $name, $body, [$attributes]), %options) β€” bestie. okay. listen. the constructor of this object does NOT follow the usual practice within the Mail::Box suite: it does not use the constructor Mail::Reporter::new(). it's different, it's special, it's got its own vibe 😭

the method can be used in one of the following ways:

  • new($line, %options) β€” pass a $line as it could be found in a file: a (possibly folded) line which is terminated by a new-line. πŸ“„
  • new($name, $body, [$attributes], %options) β€” a set of values which shape the line. ✨

create a new header field object. specify the whole $line (encoded octets) at once, and it will be split-up for you. in case you already have the parts of the header line, you may specify them separately as $name and field $body.

in case you specify a single $body object, or an ARRAY of objects, these are processed to become suitable to fill a field, usually by simple strification. when you specify one or more Mail::Address objects, these are transformed into a string using their format method. you may also add one Mail::Message::Field, whose body is taken. in case of an array, the elements are joined into one string with a comma. πŸ“

the $attributes can be exactly one string which may contain multiple attributes at once, quoted and formatted as required in RFC2822. as an alternative, a list of key-value pairs can be used. in this case, the values will get quoted if needed and everything formatted as the protocol demands. improves base, see "Constructors" in Mail::Message::Field πŸ‘‘

Β» example: πŸ‘‡
my $mime = Mail::Message::Field->new(
  'Content-Type: text/plain; charset=US-ASCII');

my $mime = Mail::Message::Field->new(
  'Content-Type' => 'text/plain; charset=US-ASCII');

my $mime = Mail::Message::Field->new(
  'Content-Type' => 'text/plain', 'charset=US-ASCII');

my $mime = Mail::Message::Field->new(
  'Content-Type' => 'text/plain', charset => 'Latin1');

my $mime = Mail::Message::Field->new(
  To => Mail::Address->new('My', 'me@example.com');

my $mime = Mail::Message::Field->new( Cc => [
  Mail::Address->new('You', 'you@example.com'),
  Mail::Address->new('His', 'he@example.com')
]);

but in practice, you can simply call

my $head = Mail::Message::Head->new;
$head->add( 'Content-Type' => 'text/plain', charset => 'utf8');

which implicitly calls this constructor (when needed). you can specify the same things for Mail::Message::Head::Complete::add() as this new accepts. so basically it's the same energy, just indirect πŸ’…


🌸 Attributes 🌸

Extends "Attributes" in Mail::Message::Field.

  • $obj->Name() β€” Inherited, see "Attributes" in Mail::Message::Field ✨
  • $obj->body() β€” Inherited, see "Attributes" in Mail::Message::Field ✨
  • $obj->folded() β€” Inherited, see "Attributes" in Mail::Message::Field ✨
  • $obj->foldedBody( [$body] ) β€” Inherited, see "Attributes" in Mail::Message::Field ✨
  • $obj->name() β€” Inherited, see "Attributes" in Mail::Message::Field ✨
  • $obj->unfoldedBody( [$body, [$wrap]] ) β€” Inherited, see "Attributes" in Mail::Message::Field ✨
  • $obj->wellformedName( [STRING] ) β€” Inherited, see "Attributes" in Mail::Message::Field ✨

πŸ‘‘ The field πŸ‘‘

Extends "The field" in Mail::Message::Field.

  • $any->isStructured( [$name] ) β€” Inherited, see "The field" in Mail::Message::Field πŸ’–
  • $obj->length() β€” Inherited, see "The field" in Mail::Message::Field πŸ’–
  • $obj->nrLines() β€” Inherited, see "The field" in Mail::Message::Field πŸ’–
  • $obj->print( [$fh] ) β€” Inherited, see "The field" in Mail::Message::Field πŸ’–
  • $obj->size() β€” Inherited, see "The field" in Mail::Message::Field πŸ’–
  • $obj->string( [$wrap] ) β€” Inherited, see "The field" in Mail::Message::Field πŸ’–
  • $obj->toDisclose() β€” Inherited, see "The field" in Mail::Message::Field πŸ’–

πŸ“ Access to the content πŸ“

Extends "Access to the content" in Mail::Message::Field.

  • $obj->addresses() β€” Inherited, see "Access to the content" in Mail::Message::Field 🌈
  • $obj->attribute( $name, [$value] ) β€” Inherited, see "Access to the content" in Mail::Message::Field 🌈
  • $obj->attributes() β€” Inherited, see "Access to the content" in Mail::Message::Field 🌈
  • $obj->comment( [STRING] ) β€” Inherited, see "Access to the content" in Mail::Message::Field 🌈
  • $any->dateToTimestamp(STRING) β€” Inherited, see "Access to the content" in Mail::Message::Field 🌈
  • $any->stripCFWS( [STRING] ) β€” Inherited, see "Access to the content" in Mail::Message::Field 🌈
  • $obj->study() β€” Inherited, see "Access to the content" in Mail::Message::Field 🌈
  • $any->toDate( [$time] ) β€” Inherited, see "Access to the content" in Mail::Message::Field 🌈
  • $obj->toInt() β€” Inherited, see "Access to the content" in Mail::Message::Field 🌈

πŸŽ€ Parsing πŸŽ€

Extends "Parsing" in Mail::Message::Field.

  • $obj->consume( $line | <$name,<$body|$objects>> ) β€” Inherited, see "Parsing" in Mail::Message::Field πŸ¦‹
  • $obj->defaultWrapLength( [$length] ) β€” Inherited, see "Parsing" in Mail::Message::Field πŸ¦‹
  • $any->fold( $name, $body, [$maxchars] ) β€” Inherited, see "Parsing" in Mail::Message::Field πŸ¦‹
  • $obj->setWrapLength( [$length] ) β€” Inherited, see "Parsing" in Mail::Message::Field πŸ¦‹
  • $obj->stringifyData(STRING|ARRAY|$objects) β€” Inherited, see "Parsing" in Mail::Message::Field πŸ¦‹
  • $obj->unfold(STRING) β€” Inherited, see "Parsing" in Mail::Message::Field πŸ¦‹

πŸ’€ Error handling πŸ’€

Extends "Error handling" in Mail::Message::Field.

  • $obj->AUTOLOAD() β€” Inherited, see "Error handling" in Mail::Reporter 😭
  • $obj->notImplemented() β€” Inherited, see "Error handling" in Mail::Reporter 😭

🧹 Cleanup 🧹

Extends "Cleanup" in Mail::Message::Field.

  • $obj->DESTROY() β€” Inherited, see "Cleanup" in Mail::Reporter πŸ™ˆ

πŸ”₯ DETAILS πŸ”₯

Extends "DETAILS" in Mail::Message::Field.


⭐ DIAGNOSTICS ⭐

  • Error: class $package does not implement method $method. β€” fatal error bestie πŸ’€ the specific $package (or one of its superclasses) does not implement this method where it should. this message means that some other related classes do implement this method however the class at hand does not. probably you should investigate this and probably inform the author of the package. Cast by notImplemented()
  • Warning: field content is not numerical: $content β€” the numeric value of a field is requested (for instance the "Lines" or "Content-Length" fields should be numerical), however the data contains weird characters πŸ‘€ Cast by toInt()
  • Error: field name too long (max $count), in '$name'. β€” it is not specified in the RFCs how long a field name can be, but at least it should be a few characters shorter than the line wrap. Cast by fold()
  • Warning: illegal character in field name $name. β€” a new field is being created which does contain characters not permitted by the RFCs 🚨 using this field in messages may break other e-mail clients or transfer agents, and therefore mutulate or extinguish your message. yes, extinguish. your whole message. gone. Cast by consume()

🌸 SEE ALSO 🌸

this module is part of Mail-Message version 4.04, built on February 04, 2026. Website: http://perl.overmeer.net/CPAN/ πŸ”—


πŸ’œ LICENSE πŸ’œ

for contributors see file ChangeLog.

this software is copyright (c) 2001-2026 by Mark Overmeer.

this is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. slay. periodt. πŸ’…βœ¨


and that's the whole page bestie 🫢 it's perl v5.42.0, dated 2026-02-05, and yes the footer says Mail::M...d::Fast(3) β€” mwah, go forth and parse some headers πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from