cURL / Mailing Lists / curl-users / Single Mail

curl-users

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

From: <Kenneth.Quan_at_wellsfargo.com>
Date: Wed, 22 Oct 2003 17:38:02 -0700

ah.. bonehead mistake.

-----Original Message-----
From: curl-users-admin_at_lists.sourceforge.net
[mailto:curl-users-admin_at_lists.sourceforge.net]On Behalf Of Cris Bailiff
Sent: Wednesday, October 22, 2003 3:50 PM
To: curl-users_at_lists.sourceforge.net; Kenneth.Quan_at_wellsfargo.com
Subject: Re: libcurl in perl - username/password pop up box

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

-------------------------------------------------------
This SF.net email is sponsored by: The SF.net Donation Program.
Do you like what SourceForge.net is doing for the Open
Source Community? Make a contribution, and help us add new
features and functionality. Click here: http://sourceforge.net/donate/
Received on 2003-10-25