version 1.8, 2014/11/13 20:09:08
|
version 1.9, 2014/11/16 02:10:41
|
Line 316 sub make_new_child {
|
Line 316 sub make_new_child {
|
sub sync { |
sub sync { |
my ($command)=@_; |
my ($command)=@_; |
$counter++; |
$counter++; |
my $expect=$counter; |
my $digits = length($counter); |
if (length($expect) > 10) { |
if ($digits > 10) { |
$counter = 1; |
$counter = 1; |
$expect = $counter; |
|
} |
} |
print $command "print($expect,digits=10);\n"; |
my $expect=$counter; |
|
print $command "print($expect,digits=$digits);\n"; |
while (1) { |
while (1) { |
my $output=&getroutput($command); |
my $output=&getroutput($command); |
chomp($output); |
chomp($output); |
Line 351 sub getroutput {
|
Line 351 sub getroutput {
|
return 'Error: '.$error; |
return 'Error: '.$error; |
} |
} |
|
|
my $foundoutput=0; |
|
my $found_label=0; |
|
my $realoutput=''; |
my $realoutput=''; |
foreach my $line (split(/\n/,$output)) { |
foreach my $line (split(/\n/,$output)) { |
$line=~s/\s$//gs; |
$line=~s/\s$//gs; |
if ($line=~/^Error\:/) { $syntaxerr=1; next; } |
if ($line=~/^Error\:/) { $syntaxerr=1; next; } |
if (my ($result)=($line=~/^\s*\[\d+\]\s*(.*)/)) { $realoutput.=$result."\n"; } |
if ($line=~ /\;$/) { next; } |
|
if (my ($result)=($line=~/^\s*\[?\d+\,?\]?\s*(.*)/)) { $realoutput.=$result."\n"; } |
} |
} |
if (wantarray) { |
if (wantarray) { |
return ($realoutput,$syntaxerr); |
return ($realoutput,$syntaxerr); |