in reply to print dropping a line?
I tried that under v5.8.0 Linux and it appeared to work fine. So the question is, what version of perl are you running? and what's your test data, the internal format.
also use strict; use warnings; they are your friends
You can also write that whole foreach loop much simpler something like this
foreach my $test (keys %Tests) { print "Test is $test\n"; # This should print them all sorted print join("\n", sort @{$Tests{$test}}); # For checking the data, shouldn't be needed in production #print "Num before sort:", $#{$Tests{$test}} + 1, "\n"; #print join("\n", @{$Tests{$test}}); #@{$Tests{$test} = sort @{$Tests{$test}}; #print "Num after sort:", $#{$Tests{$test}} + 1, "\n"; #print join("\n", @{$Tests{$test}}); }
Update: I used the same initial value for %Tests as edoc does below. (forgot to mention that)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: print dropping a line?
by edoc (Chaplain) on Jun 02, 2003 at 01:59 UTC |