{
    "mode": "perldoc",
    "parameter": "Sys::Utmp::Utent",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Sys%3A%3AUtmp%3A%3AUtent/json",
    "generated": "2026-06-13T01:53:20Z",
    "synopsis": "use Sys::Utmp;\nmy $utmp = Sys::Utmp->new();\nwhile ( my $utent =  $utmp->getutent() )\n{\nif ( $utent->userprocess )\n{\nprint $utent->utuser,\"\\n\";\n}\n}\n$utmp->endutent;",
    "sections": {
        "NAME": {
            "content": "Sys::Utmp::Utent - represent a single utmp entry\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use Sys::Utmp;\n\nmy $utmp = Sys::Utmp->new();\n\nwhile ( my $utent =  $utmp->getutent() )\n{\nif ( $utent->userprocess )\n{\nprint $utent->utuser,\"\\n\";\n}\n}\n\n$utmp->endutent;\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "As described in the Sys::Utmp documentation the getutent method returns an object of the type\nSys::Utmp::Utent which provides methods for accessing the fields in the utmp record. There are\nalso methods for determining the type of the record.\n\nThe access methods relate to the common names for the members of the C struct utent - those\nprovided are the superset from the Gnu implementation and may not be available on all systems:\nwhere they are not they will return the empty string.\n\nutuser\nReturns the use this record was created for if this is a record for a user process. Some\nsystems may return other information depending on the record type. If no user was set this\nwill be the empty string. If tainting is switched on with the '-T' switch to perl then this\nwill be 'tainted' as it is possible that the user name came from an untrusted source.\n\nutid\nThe identifier for this record - it might be the inittab tag or some other system dependent\nvalue.\n\nutline\nFor user process records this will be the name of the terminalor line that the user is\nconnected on.\n\nutpid\nThe process ID of the process that created this record.\n\nuttype\nThe type of the record this will have a value corresponding to one of the constants (not all\nof these may be available on all systems and there may well be others which should be\ndescribed in the getutent manpage or in /usr/include/utmp.h ) :\n\nACCOUNTING - record was created for system accounting purposes.\nBOOTTIME - the record was created at boot time.\nDEADPROCESS - The process that created this record has terminated.\nEMPTY - record probably contains no other useful information.\nINITPROCESS - this is a record for process created by init.\nLOGINPROCESS - this record was created for a login process (e.g. getty).\nNEWTIME - record created when the system time has been set.\nOLDTIME - record recording the old tme when the system time has been set.\nRUNLVL - records the time at which the current run level was started.\nUSERPROCESS - record created for a user process (e.g. a login )\n\nfor convenience Sys::Utmp::Utent provides methods which are lower case versions of the\nconstant names which return true if the record is of that type.\n\nuthost\nOn systems which support this the method will return the hostname of the host for which the\nprocess that created the record was started - for example for a telnet login. If taint\nchecking has been turned on (with the -T switch to perl ) then this value will be tainted as\nit is possible that a remote user will be in control of the DNS for the machine they have\nlogged in from. ( see perlsec for more on tainting )\n\nuttime\nThe time in epoch seconds wt which the record was created.\n",
            "subsections": []
        },
        "BUGS": {
            "content": "Probably. This module has been tested on Linux, Solaris, FreeBSD ,SCO Openserver and SCO\nUnixWare and found to work on those platforms. If you have difficulty building the module or it\ndoesnt behave as expected then please contact the author including if appropriate your\n/usr/include/utmp.h\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Jonathan Stowe, <jns@gellyfish.co.uk>\n",
            "subsections": []
        },
        "LICENCE": {
            "content": "This Software is Copyright Jonathan Stowe 2001-2013\n\nThis Software is published as-is with no warranty express or implied.\n\nThis is free software and can be distributed under the same terms as Perl itself.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "perl. Sys::Utmp\n",
            "subsections": []
        }
    },
    "summary": "Sys::Utmp::Utent - represent a single utmp entry",
    "flags": [],
    "examples": [],
    "see_also": []
}