So I've got a real simple script that takes a list of hosts, pings them (Net::Ping), checks to make sure we have at least X number of active machines (if we don't, something is severly wrong), and then does something else. For the record, this is ActivePerl 5.8.3 on a Wintel box.
So the code, like I said, is simple (summary below):
That's it in a nutshell. Now check out the output and notice where the "Checking threshold" line actually comes in:print "Doing some work ..."; &doSomWork(); print "Done\n"; print "Doing some ping ..."; &doSomePing(); print "Done\n"; print "Checking threshold ..."; if ($yadayadaya < $yodolodolo) { die "Horrible death"; } Print "Done\n";
The script does what it's supposed to and works fine, but I've noticed this before in other scripts and it seems like either a buffer isn't flushing or perl is just flatout deciding to rebel against the humans and work the code in it's own order.C:\temp>myScript.pl Doing some work --> Done. Doing some ping --> Done. Doing something else --> Done. Number of machines to be LAPC'd (178) below threshhold (700), please i +nvestigate ! at I:\perl\lapc.pl line 41. Checking Threshold --> C:\temp>
Bill in Brooklyn
In reply to print command buffer by Bill in Brooklyn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |