Greetings, I need to be able to re-read a file every 60 seconds until the two changing values are the same in my data file. Once the values become the same the script simply exits. Not exactly sure if my filehandle will reread itself every 60 seconds either but I keep getting compilation errors, sigh.
The data file looks like this using the | as a delimiter:
720|800

My Code:
use warnings;
use strict;
open (FH, "<datafile.txt");
@values = split(/\|/, <FH>);
while ($values[0] != $values[1]) {
       print "Not in sync...\n";
       system("sleep 60");
}
exit 0;

Thanks,
Nabeel

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to