cURL / Mailing Lists / curl-users / Single Mail

curl-users

Backticking curl in Perl

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

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. Whenever I assign each
of the file names to a perl variable and print it,

foreach my $file (@files) {
        print "The file is $file\n";
}

Some of the characters surrounding the $file variable in the print
string are overwritten by the file name. This happens both with version
7.10 and version 7.12 on Linux and MacosX.

Any suggestions?

Many thanks.

phiroc
Received on 2005-01-31