> 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;


What would the errors be?

I see you are using strict, what is the output of

# perl -c <scriptname>

Does that give you any clues?

Maybe just for testing, you want to try a sleep of 1 or 2 seconds?

what happens if the values are in sync?


-- 



Owen


-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/


Reply via email to