On 29 Jun 2001 11:31:51 +0200, BHEEKOO,KHALIL (HP-SouthAfrica,ex1)
wrote:
> Hi all
> I am brand new to programming and perl .I am having difficulty using
> functions.The perldoc is very vague and i do not know in which context to
> use function for example.
> i have an array
> @users=("ishmail","wendell")
> I need to use the getlogin function andi just cannot get the right syntax
>
> Your help will be appreciated.
>
> Khalil
<snip reason="irrelevent" />
Why do you think you need getlogin? Getlogin does not accept any
arguments and returns the name of the currently logged in user. Are you
looking for the uids of the users in @users? If so then use a foreach
loop like this:
foreach $name (@users) {
print "$name has uid ", getpwnam($name), "\n";
}
--
Today is Setting Orange, the 34th day of Confusion in the YOLD 3167
All Hail Discordia!