{
    "mode": "perldoc",
    "parameter": "User::Identity::Archive::Plain",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/User%3A%3AIdentity%3A%3AArchive%3A%3APlain/json",
    "generated": "2026-06-11T13:00:33Z",
    "synopsis": "use User::Identity::Archive::Plain;\nmy $friends = User::Identity::Archive::Plain->new('friends');\n$friends->from(\\*FH);\n$friends->from('.friends');",
    "sections": {
        "NAME": {
            "content": "User::Identity::Archive::Plain - simple, plain text archiver\n",
            "subsections": []
        },
        "INHERITANCE": {
            "content": "User::Identity::Archive::Plain\nis a User::Identity::Archive\nis a User::Identity::Item\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use User::Identity::Archive::Plain;\nmy $friends = User::Identity::Archive::Plain->new('friends');\n$friends->from(\\*FH);\n$friends->from('.friends');\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This archiver, which extends User::Identity::Archive, uses a very simple plain text file to\nstore the information of users. The syntax is described in the DETAILS section, below.\n\nExtends \"DESCRIPTION\" in User::Identity::Archive.\n",
            "subsections": []
        },
        "OVERLOADED": {
            "content": "Extends \"OVERLOADED\" in User::Identity::Archive.\n",
            "subsections": []
        },
        "METHODS": {
            "content": "Extends \"METHODS\" in User::Identity::Archive.\n",
            "subsections": [
                {
                    "name": "Constructors",
                    "content": "Extends \"Constructors\" in User::Identity::Archive.\n\nUser::Identity::Archive::Plain->new( [$name], %options )\n-Option       --Defined in             --Default\nabbreviations                           []\ndescription    User::Identity::Item     undef\nfrom           User::Identity::Archive  undef\nname           User::Identity::Item     <required>\nonly                                    []\nparent         User::Identity::Item     undef\ntabstop                                 8\n\nabbreviations => HASH|ARRAY\nAdds a set of abbreviations for collections to the syntax of the plain text archiver. See\nsection \"Simplified class names\" for a list of predefined names.\n\ndescription => STRING\nfrom => FILEHANDLE|FILENAME\nname => STRING\nonly => ARRAY|ABBREV\nLists the only information (as (list of) abbreviations) which should be read. Other\ninformation is removed before even checking whether it is a valid abbreviation or not.\n\nparent => OBJECT\ntabstop => INTEGER\nSets the default tab-stop width.\n"
                },
                {
                    "name": "Attributes",
                    "content": "Extends \"Attributes\" in User::Identity::Archive.\n\n$obj->abbreviation( $name, [$class] )\nReturns the class which is capable of storing information which is grouped as $name. With\n$class argument, you add (or overrule) the definitions of an abbreviation. The $class is\nautomatically loaded.\n\nIf $class is \"undef\", then the abbreviation is deleted. The class name which is deleted is\nreturned.\n\n$obj->abbreviations()\nReturns a sorted list of all names which are known as abbreviations.\n\n$obj->defaultTabStop( [$integer] )\nReturns the width of a tab, optionally after setting it. This must be the same as set in\nyour editor.\n\n$obj->description()\nInherited, see \"Attributes\" in User::Identity::Item\n\n$obj->name( [$newname] )\nInherited, see \"Attributes\" in User::Identity::Item\n"
                },
                {
                    "name": "Collections",
                    "content": "Extends \"Collections\" in User::Identity::Archive.\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::Archive::Plain->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::Archive.\n\n$obj->find($collection, $role)\nInherited, see \"Searching\" in User::Identity::Item\n"
                },
                {
                    "name": "Access to the archive",
                    "content": "Extends \"Access to the archive\" in User::Identity::Archive.\n\n$obj->from( <$fh|$filename|ARRAY>, %options )\nRead the plain text information from the specified $fh, $filename, STRING, or ARRAY of\nlines.\n\n-Option --Default\ntabstop  <default from object>\nverbose  0\n\ntabstop => INTEGER\nverbose => INTEGER\n"
                }
            ]
        },
        "DETAILS": {
            "content": "",
            "subsections": [
                {
                    "name": "The Plain Archiver Format",
                    "content": "Simplified class names\nIt is too much work to specify full class named on each spot where you want to create a new\nobject with data. Therefore, abbreviations are introduced. Use new(abbreviations) or"
                },
                {
                    "name": "abbreviations",
                    "content": "Predefined names: user User::Identity email Mail::Identity location User::Identity::Location\nsystem User::Identity::System list User::Identity::Collection::Emails\n\nIt would have been nicer to refer to a *person* in stead of a *user*, however that would add to\nthe confusion with the name-space.\n\nIndentation says all\nThe syntax is as simple as possible. An extra indentation on a line means that the variable or\nclass is a collection within the class on the line before.\n\nuser markov\nlocation home\ncountry NL\nemail home\naddress  mark@overmeer.net\nlocation home\nemail work\naddress  solutions@overmeer.bet\n\nemail tux\naddress tux@fish.net\n\nThe above defines two items: one User::Identity named \"markov\", and an e-mail address \"tux\". The\nuser has two collections: one contains a single location, and one stores two e-mail addresses.\n\nTo add to the confusion: the \"location\" is defined as field in \"email\" and as collection. The\ndifference is easily detected: if there are indented fields following the line it is a\ncollection. Mistakes will in most cases result in an error message.\n\nLong lines\nIf you want to continue on the next line, because your content is too large, then add a\nbackslash to the end, like this:\n\nemail home\ndescription This is my home address,     \\\nBut I sometimes use this for \\\nwork as well\naddress tux@fish.aq\n\nContinuations do not play the game of indentation, so what you also can do is:\n\nemail home\ndescription               \\\nThis is my home address,     \\\nBut I sometimes use this for \\\nwork as well\naddress tux@fish.aq\n\nThe fields \"comment\" and \"address\" must be correctly indented. The line terminations are lost,\nwhich is useful for most fields. However, if you need them, you have to check the description of\nthe applicable field.\n\nComments\nYou may add comments and white spaces. Comments start with a '#' as first non-blank character on\nthe line. Comments are not allowed on the same line as real data, as some languages (like Perl)\npermit.\n\nYou can insert comments and blank lines on all places where you need them:\n\nuser markov\n\n# my home address\nemail home\n\n# useless comment statement\naddress tux@fish.aq\nlocation #mindthehash\n\nis equivalent to:\n\nuser markov\nemail home\naddress tux@fish.aq\nlocation #mindthehash\n\nReferences\nOften you will have the need to add the same information to two items, for instance, multiple\npeople share the same address. In this case, you can create a reference. However, this is only\npermitted for whole items: you can refer to someone's location, but not to the person's street.\n\nTo create a reference to an item of someone else, use\n\nuser markov\nlocation home = user(cleo).location(home)\nlocation work\norganization   MARKOV Solutions\n\nConfiguration parameters\nYou can add some configuration lines as well. On the moment, the only one defined is\n\ntabstop = 4\n\nwhich can be used to change the meaning of tabs in the file. The default setting is 8, but some\npeople prefer 4 (or other values).\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\nWarning: Cannot read archive from $source\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::Archive::Plain - simple, plain text archiver",
    "flags": [],
    "examples": [],
    "see_also": []
}