Jump to content

[SOLVED] Perl Environment Variables Question


Recommended Posts

Hello -

 

I am currently working on a very simple script in perl.  Here is the code:

 

#!/perl/bin/perl.exe
use String::Random qw(random_regex random_string);
open FILE, "+>", "$ENV{'REMOTE_USER'}.INI" or die $!;
print FILE str;
print FILE "
str4";
print FILE 
random_regex('\d\d\d');
close FILE;
print <<HTML;
Content-type: text/html

<html><head><title>Success</title></head><body bgcolor=white>
<h1>User Created</h1>

HTML

 

The script runs fine, but gets tripped up at $ENV{'REMOTE_USER'}.  It creates a file with a blank name (ie .ini) instead of admin.ini, which is the user that is logged in when I run the script.  Any ideas as to why it is not displaying the remote user in the file name?

Upon further analysis of the problem I discovered that perl is having problems just called the remote_user variable.  I got this script from the apache documentation to test it:

 

#!/perl/bin/perl.exe

my $REMOTE_USER = $ENV{'REMOTE_USER'};

print "Content-Type: text/html\n\n";

print "The authenticated user is $REMOTE_USER\n";

 

No luck printing the remote_user!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.