in reply to End of File Woes
Firstly - if you're reading the file backwards, does it not make sense to store the first line you get (which is the last line of the file), store it somewhere and then compare to that, rather than reading the file forwards first and then backwards?
The way I perceive the module as working is not too dissimilar to what you have:
use strict; use File::ReadBackwards; my $bw = File::ReadBackwards -> new ("log.txt") or die; while (defined (my $line = $bw -> readline)) { print $line; } $bw -> close;
That seems to work fine for me on Perl 5.61 (Suse 8.0). Couple of things that spring to mine - if the @last_current_schedule array you have defined involves non-numeric values, != will never be true (and hence the file will never be read) - you should be using ne - that tests whether strings are not equal.
Last thing I can think of is to check that all your variables are referenced correctly - that you're not overwriting any data you need and that it's not getting lost somewhere.
Make sure you have use strict; at the top of the script. It'd probably help to turn warnings on too - either use warnings; or use perl -w at compile-time (older versions of Perl). That should give you some idea, hopefully, as to where the script is falling over (it'll also tells you if you've done something stupid with a variable).
Hope that helps ..
--Foxcub.
|
|---|