ViceRaid has asked for the wisdom of the Perl Monks concerning the following question:
Hi
I've inherited a script that uses curl to connect over HTTPS and get the result of a CGI. This script has worked fine for a long time, but it's suddenly started hanging. I've isolated it to:
open(CURL, qq[curl -s -N "https://www.foo.com/cgi-bin/do.cgi" |]) or die; # the script hangs here my $read = sysread(CURL, $line, 1); close(CURL);
When I run the corresponding curl command in my shell, it prints out the content I want, but doesn't finish - the CGI doesn't seem to return an EOF that curl recognises. The original script had 'my @lines = <CURL>', which also hung. However, I thought I could circumvent this by using sysread and just reading enough until I have what I want, but I still have the problem.
Thanks in advance
Alex
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Hanging when reading from pipe-y open
by matija (Priest) on Mar 30, 2004 at 12:11 UTC | |
by ViceRaid (Chaplain) on Mar 30, 2004 at 12:19 UTC | |
by Abigail-II (Bishop) on Mar 30, 2004 at 13:11 UTC |