in reply to Re: How to get system user name from windows using perl
in thread How to get system user name from windows using perl

Type SET at the command prompt to get a list of available environment variables on a Windows system.

$ENV{USERNAME} for example.

Replies are listed 'Best First'.
Re^3: How to get system user name from windows using perl
by Ralesk (Pilgrim) on Jan 27, 2012 at 15:52 UTC

    Caveat: %ENV is always byte semantics, if you have an oldish Windows and a username outside of the ANSI locale, you get question marks. One should be using Win32’s LoginName() instead which always returns character-shaped characters.