> printf() (as seen three lines down) has a format string and a list of > values corresponding to the % escapes in that string. Because you are > using a string literal you should use print() instead. > > > foreach my $i (sort { $quad{$b} <=> $quad{$a} } keys %quad) { > > if ($n++ >= $ntop) { last }; > > printf ("%6s:%s\n", $quad{$i},$i); > > } > > $n=0; > > > > printf "\nDestination Port Summary:\n"; > > foreach my $i ( sort { $port{$b} <=> $port{$a} } keys %port) { > > if ($n++ >= $ntop) { last }; > > printf ("%6s: %s\n", $port{$i},$i); > > } > > $n=0; > > > > printf "\nSource Address Summary:\n"; > > foreach my $i ( sort { $srca{$b} <=> $srca{$a} } keys %srca) { > > if ($n++ >= $ntop) { last }; > > printf ("%6s: %s\n", $srca{$i},$i); > > }
John, when I change those statements to print() from printf() I get a '%6s:%s' that prefix each line. And the count is then formatted incorrectly. Source Address Summary: %6s: %s 74969.136.253.219%6s: %s 540124.114.57.39%6s: %s 42268.146.127.17%6s: %s 40478.89.13.172%6s: %s 33975.158.126.64%6s: %s 333201.231.32.238%6s: %s 31298.212.158.147%6s: %s 30970.179.5.135%6s: %s 28286.138.224.220%6s: %s 28166.60.152.106 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/