in reply to Getting the value out a hash

You should know that => is only a "fat" comma, so my $tag1 = $words => $word; is the same as my $tag1 = $words, $word;, which is pointless. Note that => forces string-context on the left argument so you can write NAME => $value instead of "NAME", $value.

I think what you want is the following:

foreach my $word (sort keys %tag) { my $fsize = $tag{$word}; printf "<style=\"font-size:%dpx;\">%s\n", int($fsize), $word; }

PS: I would strongly recommend the use of:

use strict; use warnings;

Replies are listed 'Best First'.
Re^2: Getting the value out a hash
by Anonymous Monk on May 01, 2008 at 15:41 UTC
    Thanks for the explanations so I can learn for the future.