Maurice Aubrey wrote:

>   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


Look closely.  You're setting the header inside the bare block with local,
then AGAIN outside without it.  The local setting disappears when the block
is done, so the one outside (second last line of code) takes precedence.

-- 
Steve Sapovits
Global Sports Interactive
http://www.globalsports.com
Work Email:  [EMAIL PROTECTED]
Home Email:  [EMAIL PROTECTED]
Work Phone:  610-491-7087
Cell Phone:  610-574-7706

Reply via email to