{
    "mode": "perldoc",
    "parameter": "User::Identity::Location",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/User%3A%3AIdentity%3A%3ALocation/json",
    "generated": "2026-06-12T18:15:32Z",
    "synopsis": "use User::Identity;\nuse User::Identity::Location;\nmy $me   = User::Identity->new(...);\nmy $addr = User::Identity::Location->new(...);\n$me->add(location => $addr);\n# Simpler\nuse User::Identity;\nmy $me   = User::Identity->new(...);\nmy $addr = $me->add(location => ...);",
    "sections": {
        "NAME": {
            "content": "User::Identity::Location - physical location of a person\n",
            "subsections": []
        },
        "INHERITANCE": {
            "content": "User::Identity::Location\nis a User::Identity::Item\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use User::Identity;\nuse User::Identity::Location;\nmy $me   = User::Identity->new(...);\nmy $addr = User::Identity::Location->new(...);\n$me->add(location => $addr);\n\n# Simpler\n\nuse User::Identity;\nmy $me   = User::Identity->new(...);\nmy $addr = $me->add(location => ...);\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "The \"User::Identity::Location\" object contains the description of a physical location of a\nperson: home, work, travel. The locations are collected by a\nUser::Identity::Collection::Locations object.\n\nNearly all methods can return \"undef\". Some methods produce language or country specific output.\n\nExtends \"DESCRIPTION\" in User::Identity::Item.\n",
            "subsections": []
        },
        "METHODS": {
            "content": "Extends \"METHODS\" in User::Identity::Item.\n",
            "subsections": [
                {
                    "name": "Constructors",
                    "content": "Extends \"Constructors\" in User::Identity::Item.\n\nUser::Identity::Location->new( [$name], %options )\nCreate a new location. You can specify a name as first argument, or in the OPTION list.\nWithout a specific name, the organization is used as name.\n\n-Option      --Defined in          --Default\ncountry                             undef\ncountrycode                        undef\ndescription   User::Identity::Item  undef\nfax                                 undef\nname          User::Identity::Item  <required>\norganization                        undef\nparent        User::Identity::Item  undef\npc                                  undef\nphone                               undef\npobox                               undef\npoboxpc                            undef\npostalcode                         <value of option pc>\nstate                               undef\nstreet                              undef\n\ncountry => STRING\ncountrycode => STRING\ndescription => STRING\nfax => STRING|ARRAY\nname => STRING\norganization => STRING\nparent => OBJECT\npc => STRING\nShort name for \"postalcode\".\n\nphone => STRING|ARRAY\npobox => STRING\npoboxpc => STRING\npostalcode => STRING\nstate => STRING\nstreet => STRING\n"
                },
                {
                    "name": "Attributes",
                    "content": "Extends \"Attributes\" in User::Identity::Item.\n\n$obj->city()\nThe city where the address is located.\n\n$obj->country()\nThe country where the address is located. If the name of the country is not known but a\ncountry code is defined, the name will be looked-up using Geography::Countries (if\ninstalled).\n\n$obj->countryCode()\nEach country has an ISO standard abbreviation. Specify the country or the country code, and\nthe other will be filled in automatically.\n\n$obj->description()\nInherited, see \"Attributes\" in User::Identity::Item\n\n$obj->fax()\nOne or more fax numbers, like phone().\n\n$obj->fullAddress()\nCreate an address to put on a postal mailing, in the format as normal in the country where\nit must go to. To be able to achieve that, the country code must be known. If the city is\nnot specified or no street or pobox is given, undef will be returned: an incomplete address.\n\nexample:\n\nprint $uil->fullAddress;\nprint $user->find(location => 'home')->fullAddress;\n\n$obj->name( [$newname] )\nInherited, see \"Attributes\" in User::Identity::Item\n\n$obj->organization()\nThe organization (for instance company) which is related to this location.\n\n$obj->phone()\nOne or more phone numbers. Please use the international notation, which starts with '+', for\ninstance \"+31-26-12131\". In scalar context, only the first number is produced. In list\ncontext, all numbers are presented.\n\n$obj->pobox()\nPost Office mail box specification. Use \"P.O.Box 314\", not simple 314.\n\n$obj->poboxPostalCode()\nThe postal code related to the Post-Office mail box. Defined by new() option \"poboxpc\".\n\n$obj->postalCode()\nThe postal code is very country dependent. Also, the location of the code within the\nformatted string is country dependent.\n\n$obj->state()\nThe state, which is important for some countries but certainly not for the smaller ones.\nOnly set this value when you state has to appear on printed addresses.\n\n$obj->street()\nReturns the address of this location. Since Perl 5.7.3, you can use unicode in strings, so\nwhy not format the address nicely?\n"
                },
                {
                    "name": "Collections",
                    "content": "Extends \"Collections\" in User::Identity::Item.\n\n$obj->add($collection, $role)\nInherited, see \"Collections\" in User::Identity::Item\n\n$obj->addCollection( $object | <[$type], %options> )\nInherited, see \"Collections\" in User::Identity::Item\n\n$obj->collection($name)\nInherited, see \"Collections\" in User::Identity::Item\n\n$obj->parent( [$parent] )\nInherited, see \"Collections\" in User::Identity::Item\n\n$obj->removeCollection($object|$name)\nInherited, see \"Collections\" in User::Identity::Item\n\n$obj->type()\nUser::Identity::Location->type()\nInherited, see \"Collections\" in User::Identity::Item\n\n$obj->user()\nInherited, see \"Collections\" in User::Identity::Item\n"
                },
                {
                    "name": "Searching",
                    "content": "Extends \"Searching\" in User::Identity::Item.\n\n$obj->find($collection, $role)\nInherited, see \"Searching\" in User::Identity::Item\n"
                }
            ]
        },
        "DIAGNOSTICS": {
            "content": "Error: $object is not a collection.\nThe first argument is an object, but not of a class which extends\nUser::Identity::Collection.\n\nError: Cannot load collection module for $type ($class).\nEither the specified $type does not exist, or that module named $class returns compilation\nerrors. If the type as specified in the warning is not the name of a package, you specified\na nickname which was not defined. Maybe you forgot the 'require' the package which defines\nthe nickname.\n\nError: Creation of a collection via $class failed.\nThe $class did compile, but it was not possible to create an object of that class using the\noptions you specified.\n\nError: Don't know what type of collection you want to add.\nIf you add a collection, it must either by a collection object or a list of options which\ncan be used to create a collection object. In the latter case, the type of collection must\nbe specified.\n\nWarning: No collection $name\nThe collection with $name does not exist and can not be created.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "This module is part of User-Identity distribution version 1.01, built on February 11, 2022.\nWebsite: http://perl.overmeer.net/CPAN/\n",
            "subsections": []
        },
        "LICENSE": {
            "content": "Copyrights 2003-2022 by [Mark Overmeer <markov@cpan.org>]. For other contributors see ChangeLog.\n\nThis program is free software; you can redistribute it and/or modify it under the same terms as\nPerl itself. See http://dev.perl.org/licenses/\n",
            "subsections": []
        }
    },
    "summary": "User::Identity::Location - physical location of a person",
    "flags": [],
    "examples": [],
    "see_also": []
}