yes Chas....it says:-
there are 0 keys in hash
while (my($key, $value) = each %hash)
{
print $OUT_FILE $value;
$value++ ;
#print $LOG_FILE "Count of cdrs after removing
duplicates = " .(keys%hash). "\n";
}
seek $OUT_FILE,0,0 ;
print "there are " . (keys %hash) . " keys in
hash\n";
#print $LOG_FILE "Count of cdrs after removing
duplicates = $value" ;
close $OUT_FILE;
close $LOG_FILE ;
i think something is going terribly wrong with my code...can u quickly point
out and advice?
On 8/7/07, Chas Owens <[EMAIL PROTECTED]> wrote:
>
> On 8/7/07, Mihir Kamdar <[EMAIL PROTECTED]> wrote:
> snip
> > I am doing the following:
> >
> > while (my($key, $value) = each %hash)
> > {
> > print $OUT_FILE $value;
> > }
> >
> > seek $OUT_FILE,0,0 ;
> > my $lines = 0 ;
> > $lines++ while<$OUT_FILE> ;
> > print $LOG_FILE "Count of cdrs after removing
> > duplicates = $lines" ;
> > close $OUT_FILE;
> > close $LOG_FILE ;
> >
> > still output is 0....
> >
>
> Then it is likely that %hash is empty. Try printing the number of
> keys in %hash to make sure there is data in it:
>
> print "there are " . (keys %hash) . " keys in hash\n";
>