in reply to http POST + authentication

I don't use LWP::, but I noticed that you did not create a new instance on line 4: for your $req could it be that it should be:
my $req = new HTTP::Request::Common::POST($URL, [ # rest of your code here...

Replies are listed 'Best First'.
Re^2: http POST + authentication
by Aristotle (Chancellor) on Dec 30, 2002 at 19:13 UTC
    Have you even looked at the POD for HTTP::Request::Common? HTTP::Request::Common::POST is not a package, it's a subroutine (exported by default, so that could also be my $req = POST($URL, ...); ). The very least you can do before posting such an assumption is looking at the POD on search.cpan.org.

    Makeshifts last the longest.

Re: Re: http POST + authentication
by Grateful_Dude (Acolyte) on Dec 30, 2002 at 17:54 UTC
    my $request = new HTTP::Request::Common::POST("$URL",
    adding the "new" gives me this error:
    "Bareword found where operator expected at ./test.pl line 19, near "ne +w HTTP::Request::Common::POST" (Do you need to predeclare new?)"
    If I understand correctly, I have already created a new session with
    $ua = LWP::UserAgent->new;

      The "indirect object" syntax is source of many syntax problems. Rather omit it in order not to encounter such trouble.

      my $request = HTTP::Request::Common::POST->new("$URL", #...

      In the end, this is Perl and needn't look like Java or C++

      --
      http://fruiture.de