in reply to LWP::Useragent - why doesn't this code work? :/
At point ## 3 ##, you're relying on the value of $1 captured at point ## 1 ##; but you've re-used the regex engine in the split command at point ## 2 ##, which has probably overwritten it. Save the value of the captures immediately after they are captured.
if ($split[0] =~ m|(.*)//(.*)|) { ## 1 ## print $IN->header; #print qq|Got user/pass combo of: $2 \n|; my ($user,$pass) = split /\:/, $2; ## 2 ## $request = HTTP::Request->new(GET => qq|$1/$split[1]|); +## 3 ##
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: LWP::Useragent - why doesn't this code work? :/
by ultranerds (Hermit) on Jun 14, 2010 at 14:52 UTC | |
by almut (Canon) on Jun 14, 2010 at 15:08 UTC |