>>>>> "p" == pablo  <pa...@compugenic.com> writes:

  p> Then I tweaked my code as follows:

  p> if ( $bytes > ($sizes{$ext}->{largest}||0) ) {
  p>     print "$bytes is larger than ", $sizes{$ext}->{largest_size} || 0, 
"\n";

you missed the important part. fixed a warning like that ignores WHY
there is an undef there. 'largest' is not the same key as 'largest_size'!!!

so you are ALWAYS comparing against undef (or 0 now) which means the
current size will ALWAYS win. that is the bug. warnings showed you there
is an undef there (the 'largest' key doesn't exist) which would have
pointed you to the real bug.

uri

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