Just use $ENV{username} within your script.

--
  Simon Oliver

Björn Göhringer wrote:
> 
> 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