From: Dan Boger Date: Tue, 11 Aug 2009 05:50:40 +0000 (-0700) Subject: Fix typo in binmode. Also, try to make sure the last_poll id never decreases X-Git-Url: https://git.sommitrealweird.co.uk/twirssi-net-twitter-lite.git/commitdiff_plain/a142f72e884f598257ace2c62419ddec5f3ed7d0 Fix typo in binmode. Also, try to make sure the last_poll id never decreases --- diff --git a/twirssi.pl b/twirssi.pl index 1f0f895..aca557c 100644 --- a/twirssi.pl +++ b/twirssi.pl @@ -1032,7 +1032,7 @@ sub monitor_child { # pretend if ( open FILE, $filename ) { - bindmode FILE, ":utf8"; + binmode FILE, ":utf8"; my @lines; my %new_cache; while () { @@ -1163,8 +1163,16 @@ sub monitor_child { } if (/^-- (\d+)$/) { - ($new_last_poll) = ($1); - last; + $new_last_poll = $1; + if ( $new_last_poll >= $last_poll ) { + last; + } else { + print "Impossible! ", + "new_last_poll=$new_last_poll < last_poll=$last_poll!" + if &debug; + undef $new_last_poll; + next; + } } my ( $f, $t ) = split ' ', $_; $nicks{$f} = $friends{$f} = $t;