cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: libcurl in perl - username/password pop up box

From: Cris Bailiff <c.bailiff+curl_at_devsecure.com>
Date: Thu, 23 Oct 2003 08:49:31 +1000

Kenneth,

On Thu, 23 Oct 2003 04:03 am, Kenneth.Quan_at_wellsfargo.com wrote:
> HTTP/1.0 401 Unauthorized
> Server: atg.server.http.HttpServer
> WWW-Authenticate: Basic realm="Dynamo Admin Server"
> Content-Type: text/html
>
> I'm wondering is it because of my stupid with the following line.. I'm
> using @ in p_at_ass to show as an example because my password has an @ sign.

Yes.

> $curl->setopt(CURLOPT_USERPWD, "user:p_at_ss");

You need to escape the @ in a double quoted string, or use single quotes -
"user:p\@ss" or 'user:p_at_ss'

Perl would have told you this if you enable warnings: use '-w' on the script
line:

#!/usr/bin/perl -w

From the perl faq:

Always use -w. Try to "use strict;" (or "use strict qw(...);").
Remember that you can add "no strict qw(...);" to individual blocks
of code which need less strictness. Always use -w. Always use -w!

Cheers,
Cris

-------------------------------------------------------
This SF.net email is sponsored by OSDN developer relations
Here's your chance to show off your extensive product knowledge
We want to know what you know. Tell us and you have a chance to win $100
http://www.zoomerang.com/survey.zgi?HRPT1X3RYQNC5V4MLNSV3E54
Received on 2003-10-23