|
|
| Syntactic Confectionery Delight | |
| PerlMonks |
Re^3: LWP::USERAGENT - POST through basic authenticationby Khen1950fx (Canon) |
| on Oct 12, 2011 at 14:54 UTC ( #931031=note: print w/ replies, xml ) | Need Help?? |
|
Where do I put the $args You don't. In some of the Net modules, you can use a %args for options, but since this is LWP, there's a slightly different way to do that. For example, in the example that I gave you, I tried to keep it simple, step-by-step. Lets look at another way to do it. $req = HTTP::Request->new(POST => $self->{'baseurl'}, $args); First, you're missing a shebang line( #!/usr/bin/perl ) and strictures. You also need to declare your variables with my. Another problem is your use of $self->{'baseurl'}---What's that? You didn't declare $self nor $args. Putting it altogether:Note that the url should be absolute; also, I dropped $self->{'baseurl'} and $args because they weren't necessary and didn't do anything. Now you know where to put $args:).
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||