in reply to Alphabetically sorting hashes

to sort out and print a hash alphabetically based on key:
foreach(sort keys %hash){ print "$_ -> $hash{$_}\n"; }
to sort out and print a hash alphabetically based on value:
foreach(sort {$hash{$a} cmp $hash{$b}} keys %hash){ print "$_ -> $hash{$_}\n"; }
Now specifically to fit your question:
foreach(sort keys %usernames){ print "$_ $passwords{$_} $bgcolors{$_} $fgcolors{$_}\n"; }