Please tell us more about OUTPUT. When I changed the output to be STDOUT (with default $|) it worked just fine. Maybe your file handle does some buffering?
%RegStudentNew = qw( foo 1 bar 2 ); %RegInstructorNew = qw( foo 1 bar 2 ); %RegStudentExisting = qw( foo 1 bar 2 ); print "New Student Registrations\n----------------------\n"; foreach my $Inst (sort keys %RegStudentNew) { if ($RegStudentNew{$Inst} ) { print "$Inst\t$RegStudentNew{$Inst}\n"; } } print "\nNew Instructor Registrations\n--------------------\n"; foreach my $Inst (sort keys %RegInstructorNew) { if ($RegInstructorNew{$Inst} ) { print "$Inst\t$RegInstructorNew{$Inst}\n"; } } print "\nExisting Student Registrations\n-----------------\n"; foreach my $Inst (sort keys %RegStudentExisting) { if ($RegStudentExisting{$Inst} ) { print "$Inst\t$RegStudentExisting{$Inst}\n"; } }
cpt2jmo@phantom:~/misc$ perl print.pl New Student Registrations ---------------------- bar 2 foo 1 New Instructor Registrations -------------------- bar 2 foo 1 Existing Student Registrations ----------------- bar 2 foo 1
In reply to Re: Printing out of order...
by puudeli
in thread Printing out of order...
by kdmurphy001
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |