I don'tknow if this is the best way but I ended up doing this:
my $UID = getpwuid($<);
my @GROUPS = split(" ",`groups $UID`);
Which gets the groups that the user who is running my script belongs
too.
correct me if I am wrong?
EDOG
On Wed, 2003-08-27 at 16:00, Dan Muey wrote:
> Hello all
Howdy
> I want to us the variable $< to get the REAL UID of the perl
> program that is running. How can I get the users name from
> that number it gives me?
Depends on the system.
Have you looked on cpan for a module that does that?
You can always qx() the same way you'd do it via command line.
IE if you can do
$ /usr/bin/sername 0
root
$
Then you can do perhaps:
my $userfromid = qx(/usr/bin/username $<);
HTH
DMuey
>
> Thanks
> Eric Walker
>
>
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]