in reply to Windows Username

With the following you get a list of all environment variables and their current values:
foreach my $env_var (keys %ENV){ print "$env_var: $ENV{$env_var}\n"; }
USERNAME should be among them ...

pelagic

Replies are listed 'Best First'.
Re: Re: Windows Username
by bkiahg (Pilgrim) on Apr 26, 2004 at 13:24 UTC
    REMOTE_USER, LOGON_USER and AUTH_USER all do the trick. Which would be the best to use? Or are they all the same?
      I'm afraid I can't answer that. That's dependant of you setup, which I don't know. What software/component/action creates what variable a.s.o. ... Some test's might show you the way to go.
      BTW be aware that all this assumes that the perl script is run by the USER or on his Workstation.

      pelagic