I have a program like this:
#!/usr/bin/perl -w
$|=1;
while (1){
blah();
if ($success){
localsearch();
report(); # this is OK
}
}
exit 1;
sub report {
system "clear";
print "this $value \n";
print FILE "this $value \n";
return;
}
sub localsearch {
doimprove();
report(); # this is not OK, doesn't seems to work
return;
}
Do you have an explanation to that bahavior?
gamo <gamo@telecable.es> writes:
I have a program like this:
#!/usr/bin/perl -w
$|=1;
while (1){
blah();
if ($success){
localsearch();
report(); # this is OK
}
}
exit 1;
sub report {
system "clear";
print "this $value \n";
print FILE "this $value \n";
return;
}
sub localsearch {
doimprove();
report(); # this is not OK, doesn't seems to work
return;
}
Do you have an explanation to that bahavior?
Something is wrong in a part of the program you are not showing us.
Post as short a complete example as you can and trt to say what you mean
by doesn't seem to work.
On 05/22/2021 15:57, gamo wrote:
Sorry Ben, but I think I wrote the basic structure and the result is
that the screen does not blink at the spected rate.
If he can't run it (insufficient code provided), how do you expect him to debug it for you?
You need to provide the smallest running and failing example possible.
In the process of creating that, you'll probably fix it yourself. ;)
Sorry Ben, but I think I wrote the basic structure and the result is
that the screen does not blink at the spected rate.
El 23/5/21 a las 1:43, $Bill escribió:
On 05/22/2021 15:57, gamo wrote:
Sorry Ben, but I think I wrote the basic structure and the result is
that the screen does not blink at the spected rate.
If he can't run it (insufficient code provided), how do you expect him to
debug it for you?
You need to provide the smallest running and failing example possible.
In the process of creating that, you'll probably fix it yourself. ;)
Thanks, Bill, that's a good idea, but I could go the other way around
trying to find a replacement to
system "clear";
which I think is the weak point of the chain, and see what happens.
Thanks, Bill, that's a good idea, but I could go the other way aroundYou may be able to capture the control sequence that clear uses so you
trying to find a replacement to
system "clear";
which I think is the weak point of the chain, and see what happens.
don't have to run a command every time:
my $cls = `clear`;
...
print $cls, "this $value\n";
or you can use $cls = `tput clear` if you have the tput command.
But I imagine the problem is to do with the timing since you are
probably relying on a software emulation of a terminal.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 293 |
Nodes: | 16 (2 / 14) |
Uptime: | 234:58:43 |
Calls: | 6,624 |
Files: | 12,172 |
Messages: | 5,319,707 |