On Wed, Feb 27, 2002 at 09:52:59PM -0300, Eduardo M. Cavalcanti wrote:
> At 15:49 27/2/2002 -0800, you wrote:
[snip]
> >local is your fried:
> >
> >{
> >    local $HTTP::Headers::TRANSLATE_UNDERSCORE = 0;
> >    $the_request->headers->header(REMOTE_ADDR=>'234.234.234.234');
> >}
> 
> I have just tried it but does not work.

Can you show us how it fails?  It appears to work fine to me.

  #!/usr/bin/perl -w

  use strict;
  use LWP;

  my $req = HTTP::Request->new(GET => 'http://www.yahoo.com/');
  {
    local $HTTP::Headers::TRANSLATE_UNDERSCORE = 0;
    $req->headers->header(REMOTE_ADDR => '234.234.234.234');
  }
  $req->headers->header(REMOTE_ADDR => '127.0.0.1');
  print $req->as_string;

[maurice@yoda maurice]$ /tmp/try
GET http://www.yahoo.com/
REMOTE-ADDR: 127.0.0.1
REMOTE_ADDR: 234.234.234.234

Maurice

Reply via email to