I'm trying to use curl from a perl script using a piped open format:

my @cmd = ('curl', '-u','username:password', '-g','-T', "$upfile","mydomain/directory");
die '@cmd must have more than one element' unless @cmd>1;
open my $fh,'-|', @cmd or die $!;
close $fh or die $! ? $! : $?;

but am getting this error

curl: (23) Failed writing body

Running macOS 13.3. Anyone shed some light please?


1 Answer 1


OK, now I feel a bit embarassed. In the URL string I neglected to include the protocol 'ftp://'. DUH

This process AKA 'IPC' Inter-process Communication is something I've not heard of but disovered it at https://www.perlmonks.org/? under ‘2. Use a Piped open’ doing resarch on curl.

Apologies to all who may have run into this rabbit hole.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .