$CalcData->{$main}{'uppercase'} += $uppercase;
$CalcData->{$main}{'smiley_happy'} += $smiley_happy;
$CalcData->{$main}{'smiley_sad'} += $smiley_sad;
+
+ require Data::Dumper;
+ print STDOUT Data::Dumper->Dump ([$CalcData->{$main}], ["CalcData->{$main}"]);
}
}
sub output
{
+ calculate ();
+
my $first_nick;
my $first_name;
my $second_nick;
}
if (defined ($QuoteCache->{$nick}))
{
- my @new = sort (sub { $b->[0] <=> $a->[0] }, @{$QuoteCache->{$nick}}, @{$QuoteData->{$main}});
+ my @new = ();
+ push (@new, @{$QuoteData->{$main}}) if (@{$QuoteData->{$main}});
+ push (@new, @{$QuoteCache->{$nick}}) if (@{$QuoteCache->{$nick}});
+
+ @new = sort { $b->[0] <=> $a->[0] } (@new);
splice (@new, $QuoteCacheSize) if (scalar (@new) > $QuoteCacheSize);
+
$QuoteData->{$main} = \@new;
}
}
{
my $num = scalar (@{$QuoteData->{$nick}});
my $rand = int (rand ($num));
+
+ require Data::Dumper;
+ print STDOUT Data::Dumper->Dump ([$rand, $QuoteData->{$nick}], ['rand', "QuoteData->{$nick}"]);
+
$quote = html_escape ($QuoteData->{$nick}[$rand][1]);
}