User::utmp Copyright © 1998 Michael Piotrowski. All Rights Reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. Description ----------- This module provides a simple Perl interface to utmp-style databases on UNIX systems, the most important being /etc/utmp, which provides information about users currently logged in. For more details see the POD documentation embedded in the file Utmp.pm. Prerequisites ------------- Your system should be compliant with SVID2 or at least provide setutent(), getutent(), endutent(), utmpname() functions compliant with SVID2. Portability note ---------------- Unfortunately, the contents of the Utmp structure are highly system-dependent, making multi-platform support difficult. Using Utmpx instead looks like a good idea because it is standardized by XPG4. However, Utmpx is not yet universally supported. User::Utmp now uses hint files (see the hints directory and the ExtUtils::MakeMaker man page) to control the inclusion of system-dependent code. Note that the Linux hint file enables support for the ut_host and ut_addr fields; these fields exist on the system I tested it, which is fairly recent. Older versions of Linux seem to have much more limited Utmp implementations. I'd appreciate a note if you know of ways to support those without having to parse the header files. Building the module ------------------- The module can be built using this sequence of commands: perl Makefile.PL make make test "make test" just tests if the module is loadable, since I don't have a good idea for portable tests. I've included the script example.pl instead, which is a variation of what I use for testing. Installation ------------ make install History ------- User::Utmp was developed as a quick solution for a project at hand. It's therefore a straightforward translation of the C interface to Perl, but reduces the number of functions from four to two. It has the following limitations: - It's not object-oriented - It's not reentrant and therefore not thread-safe - It reads the whole file User::Utmp is used extensively in an in-house project and seems to work well. However, since it has not been tested elsewhere, consider this a beta release. Feedback -------- User::Utmp was tested on HP-UX 10.20, Solaris 2.5.1, and Linux 2.0.36. If you are building the module on another architecture I'd appreciate a note about how you got on. Michael Piotrowski