I am by no means an expert, (I'm barely a beginner!), but isn't the username
available through the @ENV array?

Regards
Mark

-----Original Message-----
From: Björn Göhringer [mailto:[EMAIL PROTECTED]]
Sent: 10 October 2001 09:54
To: [EMAIL PROTECTED]
Subject: trying to access nt-variables to include it in html


we want to include the environment variable "username" in an html page
so we can start different actions depending on which user is logged in
and accesses the page. so when i go to the command line and execute the
command

c:\> perl -e "system(\"set > variables.txt\")";

i get a list of all the nt variables in the file "variables.txt"
including username (USERNAME=administrator, for example). now i made a
script which should create an html page and include the variable:

print "<html>...blablabla";
...
system("set > variables.txt");
$file = "variables.txt";
open FILE, $file;
while (<FILE>) {
    if ($_ =~ /USERNAME=(.+)/) {
        $username = $1;
    }
}
print $username;
...

when i call this script in the browser, i get a list of all the
WEBSERVER variables in the file, which do NOT include username! how can
i access this variable from the script???
thanks in advance,
björn

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users


Reply via email to