Mail::M...ddrGroup(3)
π Mail::Message::Field::AddrGroup π
okay so bestie, welcome to Mail::M...ddrGroup(3) from the User Contributed Perl Documentation β¨ This one is literally a whole group of Mail::Message::Field::Address objects. Like a little squad. A friend group. A vibe. π«Ά
πΈ NAME πΈ
Mail::Message::Field::AddrGroup β a group of Mail::Message::Field::Address objects. That's it, that's the whole thing, and honestly? iconic. π
π¦ INHERITANCE π¦
the family tree, no cap:
Mail::Message::Field::AddrGroup
is a User::Identity::Collection::Emails
is a User::Identity::Collection
is a User::Identity::Item
so she's got ancestors, she's got lore, she's got main character energy all the way down the chain π
β¨ SYNOPSIS β¨
here's the vibe check, run it:
my $g = Mail::Message::Field::AddrGroup->new(name => 'name');
my $a = Mail::Message::Field::Address->new(...);
$g->addAddress($a);
my $f = Mail::Message::Field::Addresses->new;
$f->addGroup($g);
π DESCRIPTION π
An address group collects a set of e-mail addresses (in this case they are Mail::Message::Field::Address objects). that's the whole job bestie, she holds the little address besties together π
Extends "DESCRIPTION" in User::Identity::Collection::Emails.
π OVERLOADED π
Extends "OVERLOADED" in User::Identity::Collection::Emails.
overload: "" stringificationβ Returns thestring()value. simple as that, no drama π«Άoverload: '""' stringificationβ Inherited, see"OVERLOADED"inUser::Identity::Collectionoverload: '@{}' array dereferenceβ Inherited, see"OVERLOADED"inUser::Identity::Collection
π METHODS π
Extends "METHODS" in User::Identity::Collection::Emails.
$obj->string()β Returns the address group as string. When no name is specified, it will only be a comma separated list of addresses. With a name, the groups name will be prepended and a semi-colon appended. When no addresses where included and there is no name, thenundefis returned. so like, sometimes she gives youundefand that's just her mood fr fr π
π§ Constructors π§
Extends "Constructors" in User::Identity::Collection::Emails.
$obj->coerce($object)β Coerce an$objectinto aMail::Message::Field::AddrGroup. Currently, you can only coerceUser::Identity::Collection::Emails(which is the base class for this one) into this one. just the one option bestie, she's picky π$class->new( [$name], %options )β Inherited, see"Constructors"inUser::Identity::Collection::Emails
β Attributes β
Extends "Attributes" in User::Identity::Collection::Emails.
$obj->description()β Inherited, see"Attributes"inUser::Identity::Item$obj->itemType()β Inherited, see"Attributes"inUser::Identity::Collection$obj->name( [$newname] )β Inherited, see"Attributes"inUser::Identity::Item$obj->roles()β Inherited, see"Attributes"inUser::Identity::Collection
π Collections π
Extends "Collections" in User::Identity::Collection::Emails.
$obj->add($collection, $role)β Inherited, see"Collections"inUser::Identity::Item$obj->addCollection( $object | <[$type], %options> )β Inherited, see"Collections"inUser::Identity::Item$obj->collection($name)β Inherited, see"Collections"inUser::Identity::Item$obj->parent( [$parent] )β Inherited, see"Collections"inUser::Identity::Item$obj->removeCollection($object|$name)β Inherited, see"Collections"inUser::Identity::Item$any->type()β Inherited, see"Collections"inUser::Identity::Item$obj->user()β Inherited, see"Collections"inUser::Identity::Item
π Maintaining roles π
Extends "Maintaining roles" in User::Identity::Collection::Emails.
$obj->addRole($role|([$name], %options))β Inherited, see"Maintaining roles"inUser::Identity::Collection$obj->removeRole($role|$name)β Inherited, see"Maintaining roles"inUser::Identity::Collection$obj->renameRole( <$role|$oldname>, $newname )β Inherited, see"Maintaining roles"inUser::Identity::Collection$obj->sorted()β Inherited, see"Maintaining roles"inUser::Identity::Collection
π₯ Searching π₯
Extends "Searching" in User::Identity::Collection::Emails.
$obj->find($name|CODE|undef)β Inherited, see"Searching"inUser::Identity::Collection
π Addresses π
$obj->addAddress(STRING|$address|%options)β Add one e-mail address to the list which is maintained in the group. This is a wrapper aroundaddRole()adding flexibility on how addresses are specified. An$addresscan be anything which is acceptable forMail::Message::Field::Address::coerce()or a list of options which will create such an object. she's flexible like that, she contains multitudes π«Ά
Β» example: of adding an address to an address group
my @data = (full_name => "Myself", address => 'me@tux.org');
$group->addAddress(@data);
my $addr = Mail::Message::Field::Address->new(@data);
$group->addAddress(@data);
my $ma = Mail::Address->new(...);
$group->addAddress($ma);
$obj->addresses()β Returns all addresses defined in this group. The addresses will be ordered alphabetically to make automated testing possible: roles are stored in a hash, so have an unpredictable order by default. yeah bestie, hashes do be like that, no order, chaos gremlin behavior π
Β» example: getting all addresses from a group
my @addrs = $group->addresses;
my @addrs = map $_->address, $self->roles; #same
π Error handling π
that's literally the whole heading. no content. she said "error handling" and then said nothing else. the silence is the statement. π
π DIAGNOSTICS π
Error: cannot coerce a $type into a $class.β Cast bycoerce()Error: cannot create a $type to add this to my collection.β Some options are specified to create a$typeobject, which is native to this collection. However, for some reason this failed. Cast byaddRole()Error: cannot load collection module for $type ($class): $@β Either the specified$typedoes not exist, or that module named$classreturns compilation errors. If the type as specified in the warning is not the name of a package, you specified a nickname which was not defined. Maybe you forgot the'require'the package which defines the nickname. Cast byaddCollection()Error: cannot rename $from into $to: already exists.β Cast byrenameRole()Error: cannot rename $from into $to: doesn't exist.β Cast byrenameRole()Error: invalid collection $name.β The collection with$namedoes not exist and can not be created. Cast byadd()Error: this $object is not a collection.β Cast byaddCollection()Error: wrong type of role for $collection: requires a $expect but got a $type.β Each$collectiongroups sets of roles of one specific type ($expect). You cannot add objects of a different$type. Cast byaddRole()
π 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.
okay that's the whole page bestie, you ate that π
β this was perl v5.42.0, dated 2026-02-05, and she's Mail::M...ddrGroup(3) forever. periodt. πππ¦
π¦ where this page comes from
- fedora 44: perl-Mail-Message 4.04-1.fc44 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms