It worked for everything except the pipe symbol "|"
 
It seems to be working fine after I've included the whole URL in double qoutes ""
 
www:~/pl$ ./t.pl "http://207.211.106.40/?adserv|2.0|2|28243|1|1|ADFORCE"
OK
 0.082  12.0kb: http://fp.cache.imgis.com/images/Ad156278St1Sz1Sq8Id8.gif
 
Thank you all
Jumana
-----Original Message-----
From: Frederic Hurtubise [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 04, 2000 10:53 AM
To: Jumana Samara
Cc: '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]'
Subject: Re: Symbols in URL

$url =~ s/([^a-zA-Z0-9_.-])/uc sprintf("%%%02x",ord($1))/eg;

will work for all non alphabetical characters

Jumana Samara wrote:

Hi, I have the same problem with the symbol "|" in URLs. I am using LWP in a
script that checks a list of URLs and returns the download time. If the URL
contains the symbol "|", it will think that it is a pipe and I will get the
following output:

www:~/pl$ ./t.pl http://207.211.106.40/?adserv|2.0|2|28243|1|1|ADFORCE
bash: 2.0: command not found
bash: 2: command not found
bash: 28243: command not found
bash: 1: command not found
bash: 1: command not found
bash: ADFORCE: command not found
Broken Pipe

But if I add the symbol "\" befre each "|", it will work fine:

~/pl$ ./t.pl http://207.211.106.40/?adserv\|2.0\|2\|28243\|1\|1\|ADFORCE
OK
0.73    11.2kb: http://fp.cache.imgis.com/images/dadc_recycle_ban2.gif

Would you please help me? I can't add the symbol "\" manually, because I
have lots of URLs that get changed all the time and I can't search for each
"|"

Any suggestions are highly appreciated.

Jumana S.

----------------------------------------------------------------------------
------------------------------------------

Tatarskih Denis <[EMAIL PROTECTED]> writes:

> I have problem with using some symbols in arguments for cgi-scripts.
> If I use '|' in
> ...
> $rq = new HTTP::Request('GET',
'http://www.somewhere.com/cgi-script?arg1&|arg2');
> ...
> server recieve request 'GET /cgi-script?arg1&%7Carg2 HTTP/1.0', but if I
> type the same URL in location bar of browser (Netscape, Lynx, Konquerror),
> server recieve it as is (/cgi-script?arg1&|arg2).
> Analogically, if I use NetCat ( nc www.somewhere.com 80 < request_file )
>
> Of course, I can use NetCat, but could somebody help me, how I can do it
> with LWP?

The problem is that "|" is not a legal URI character, and LWP will
always let URI.pm fix its URIs before sending them off to the server.
There is no easy way to avoid that with LWP.

Why does it matter?

Regards,
Gisle

--
Frederic Hurtubise [[EMAIL PROTECTED], ICQ: 390555, AIM: FrenchEgg]
Application Development Leader,
HBE Software Inc. [www.hbesoftware.com]
1030 St-Alexandre, Suite 710
Montreal, Quebec H2Z 1P3
T: (514) 876-7881 F: (514) 876-9223
______________________________________________________________________________________
Get free email, calendars, file sharing, and an Internet workspace at www.opendesk.com
 

Reply via email to