cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Backticking curl in Perl

From: Rafael Garcia-Suarez <rgarciasuarez_at_gmail.com>
Date: Mon, 31 Jan 2005 16:33:56 +0100

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