Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Building a tag cloud from a database

by stiller (Friar)
on Apr 29, 2008 at 12:57 UTC ( #683453=note: print w/ replies, xml ) Need Help??


in reply to Building a tag cloud from a database

Update:Looking over it again, you have a lot of errors in you program that perl would have told you about if you didn't predeclare you variables, like the one I point out first below /update

v----- NOT $count? while (($word, $occurrence) = $sth->fetchrow_array ){ %dbtags = ($word, $count); } ^--- NOT $occurence?

If you'd done
while (my ($word, $occurence) =
rather than predeclaring your $count, perl could have told you.

foreach $k (@sortkeys) {
make it

foreach my $k (@sortekeys) {

sub DetermineFontSize ($) sub DetermineFontSize

print <<EOT print <<"EOT";

Update2:You should also try Data::Dumper, and do some print Dumper( \$var ) various places in your code, start with print Dumper( \%dbtags ); just after pulling from the database. Then, ask yourself why you never use that hash again....


Comment on Re: Building a tag cloud from a database
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://683453]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (13)
As of 2015-07-06 19:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (81 votes), past polls