Gossamer Forum
Home : General : Perl Programming :

LWP question.

Quote Reply
LWP question.
so far I got
my $tmp_text = "member=jason&source=home";
my $ua = new LWP::UserAgent;
my $request = new HTTP::Request ('POST','http://www.something.com/member.cgi?open');
$request->content_type('application/x-www-form-urlencoded');
$request->agent("Mozilla/5.0");

$request->content($tmp_text);

my $response = $ua->request($request);
$content = $response->content;

print "$content";

but how could I set the envirionment variables:
$ENV{'SERVER_NAME'}
$ENV{'HTTP_REFERER'}

for the send?


Quote Reply
Re: LWP question. In reply to
so theres nothing like

$request->server_name('yahoo.com'); or anything similar... ??????????

Quote Reply
Re: LWP question. In reply to
Well, this would be a bit complicated since the environmental variables you have listed are used as referring variables meaning that those are tracked when someone accesses your site.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.
Quote Reply
Re: LWP question. In reply to
The referring environmental variables are collected when users come to your site...not the other way around.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.
Quote Reply
Re: LWP question. In reply to
There are some things you can define, such as useragent. I am not sure about other environment variables.

------------------
Turk Scripts
turkiyem.com/turkscripts/


Quote Reply
Re: LWP question. In reply to
Yes..UserAgent..which is internal to the server...But referring environmental variables cannot be defined until a user comes to your site.

Wink

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.