in reply to How to make a progress counter for parsing HTML with HTML::TreeBuilder
Spotted at a glance.
$filetell += length $filec should be $filetell += length $buf of course, but the interesting part here is: how did I spot it?
Well, you say my $filesize = length $filec and are repeating yourself (code smell!) calculating length $filec in a loop, in which $filec doesn't change: that's nonsensical. Only after these findings did I fully grok the program (i.e. fully compiled it in my mind) and concluded: "that should be $buf".
And that's a good point for "peer programming" - since we write programs in different ways, we also read code in different ways (TIMTOWTDI applies also for reading), and thus are much better at spotting bugs by others than bugs perpetrated by $self.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to make a progress counter for parsing HTML with HTML::TreeBuilder
by ambrus (Abbot) on Oct 31, 2014 at 17:55 UTC | |
by shmem (Chancellor) on Nov 01, 2014 at 22:23 UTC | |
|
Re^2: How to make a progress counter for parsing HTML with HTML::TreeBuilder
by GotToBTru (Prior) on Nov 03, 2014 at 15:33 UTC |