C
Carlo Filippini
Hi
I try to measure how fast an ftp download is going on the
fly. I do something like:
$|=1;
my $count =0;
open (CMD, "ftp.script 2>&1 |") or die "Can't execute: $!";
while (<CMD>){
print "Result: $_ \n";
if ($_ =~ /\#/) {
$count ++;
}
The problem is that the 'ftp.script' returns me the hashes, but all
toghter. So basically $count is only 1 after execution. In other words
the output that I get is:
Result: Connected to... bla bla
Result: Downloading ...
Result: ######################################################
Result: Download complete
What I want is:
Result: Connected to... bla bla
Result: Downloading ...
Result: #
Result: #
Result: #
Result: #
Result: #
Result: #
Result: #
....
Result: Download complete
I have tried $|=1; but it does not help. The original script does
write the hashes one by one to STDOUT. Is there any way to force
'ftp.script' to pass me the hashes one by one? I use a windows
machine.
Thanks
Carlo
I try to measure how fast an ftp download is going on the
fly. I do something like:
$|=1;
my $count =0;
open (CMD, "ftp.script 2>&1 |") or die "Can't execute: $!";
while (<CMD>){
print "Result: $_ \n";
if ($_ =~ /\#/) {
$count ++;
}
The problem is that the 'ftp.script' returns me the hashes, but all
toghter. So basically $count is only 1 after execution. In other words
the output that I get is:
Result: Connected to... bla bla
Result: Downloading ...
Result: ######################################################
Result: Download complete
What I want is:
Result: Connected to... bla bla
Result: Downloading ...
Result: #
Result: #
Result: #
Result: #
Result: #
Result: #
Result: #
....
Result: Download complete
I have tried $|=1; but it does not help. The original script does
write the hashes one by one to STDOUT. Is there any way to force
'ftp.script' to pass me the hashes one by one? I use a windows
machine.
Thanks
Carlo