Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

getpwuid absent from Active State Perl?

by c (Hermit)
on May 31, 2002 at 13:38 UTC ( [id://170697]=perlquestion: print w/replies, xml ) Need Help??

c has asked for the wisdom of the Perl Monks concerning the following question:

hello all, i'm making the attempt to get a script i've written fully compatible with the win32 platform. i'm running active state perl Perl v5.6.1 , binary build 631

right off the bat, i am running into problems. my script makes a call to getpwuid to place the value into a variable

## pull as global for filename comments my $user = getpwuid($<);

however, this produces the following error

'The getpwuid function is unimplemented at pancho line 184.'

i checked over on Active State's website and in their docs section, they make a reference to the entire getpw group. it certainly seems as though the fuction is available to the distribution.

has anyone encountered this? is my code incorrect for a win32 platform (Win2k)?

humbly -c

Replies are listed 'Best First'.
Re: getpwuid absent from Active State Perl?
by particle (Vicar) on May 31, 2002 at 13:52 UTC
    the answer is in their docs as well. look under FUNCTION IMPLEMENTATIONS. perlport is the best place to look if you want to make sure your code is portable.

    ~Particle *accelerates*

Re: getpwuid absent from Active State Perl?
by vkonovalov (Monk) on May 31, 2002 at 16:19 UTC
    if you're on Win32 and not Cygwin (which *does* have getpwuid and on Win32), then it's probably better to try using 'getlogin' function, may be optionally checking for $^O to be equal to 'Win32'.
    Vadim

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://170697]
Approved by jlk
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2024-04-19 02:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found