cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Backticking curl in Perl

From: Philippe de Rochambeau <pderochambeau_at_iht.com>
Date: Mon, 31 Jan 2005 16:59:38 +0100

Many thanks.

Philippe

On 31 Jan 2005, at 16:33, Rafael Garcia-Suarez wrote:

> On Mon, 31 Jan 2005 16:20:49 +0100, Philippe de Rochambeau
> <pderochambeau_at_iht.com> wrote:
>> Hello,
>>
>> whenever I do this
>>
>> use strict;
>> my @files = `curl --max-time 120 --list-only --disable-epsv --silent
>> --show-error ftp://anonymous\@ftp.apple.com`; (or any other ftp site)
>> chomp @files;
>> print "files : @files\n";
>>
>> A jumbled-up list of files is printed onscreen.
>
> you're getting DOS-style line endings in your @files (i.e. with
> spurious Ctrl-M characters).
> Remove them, e.g. by doing
>
> s/\cM// for @files;
>
> after "chomp".
>
Received on 2005-01-31