User(3pm) - phpMan

Command: man perldoc info search(apropos)  


User(3)                        User Contributed Perl Documentation                        User(3)



NAME
       User - API for locating user information regardless of OS

SYNOPSIS
         use User;

         my $cfg = Config::IniFiles->new
               (
                 -file    => sprintf("%s/%s", User->Home, ".ncfg"),
                 -default => 'Default'
               );

         print "Your login is ", User->Login, "\n";

DESCRIPTION
       This module is allows applications to retrieve per-user characteristics.

METHODS
       Home
           Returns a location that can be expected to be a users "Home" directory on either Win-
           dows or Unix.

           While one way of writing this would be to check for operating system and then check
           the expected location for an operation system of that type, I chose to do the follow-
           ing:

            sub Home {

             return $ENV{HOME}        if $ENV{HOME};
             return $ENV{USERPROFILE} if $ENV{USERPROFILE};
             return  "";

            }

           In other words, if $HOME is defined in the user's environment, then that is used. Oth-
           erwise $USERPROFILE is used. Otherwise "" is returned.

           A contribution for Macintosh (or any other number of OS/arch combinations) is greatly
           solicited.

       Login
           Returns login id of user on either Unix or NT by checking "getlogin", "getpwuid", and
           various environment variables.

       EXPORT

       None by default.

COPYRIGHT INFO
       Copyright: Copyright (c) 2002 Terrence Monroe Brannon.  All rights reserved.  This program
       is free software; you can redistribute it and/or modify it under the same terms as Perl
       itself.

       License: GPL, Artistic, available in the Debian Linux Distribution at /usr/share/com-
       mon-licenses/{GPL,Artistic}

AUTHOR
       T.M. Brannon, tbone AT cpan.org

       Additions by Rob Napier, rnapier AT employees.org

ACKNOWLEDGEMENTS
       I would like to offer profuse thanks to my fellow perl monk at www.perlmonks.org,
       the_slycer, who told me where HOME could be found on Windows machines.

       I would also like to thank Bob Armstrong for providing me with the text of the copyright
       notice and for including this in the Debian Linux distribution.

       perl(1).



perl v5.8.3                                 2002-11-03                                    User(3)

Generated by $Id: phpMan.php,v 4.49 2006/02/26 13:18:18 chedong Exp $ Author: Che Dong
On Apache
Under GNU General Public License
2012-05-25 04:43 @38.107.179.236 Crawled by CCBot/1.0 (+http://www.commoncrawl.org/bot.html)
Valid XHTML 1.0!Valid CSS!