in reply to output difficult to understand
First of all, there are multiple gender types here, not just males. Second, add <c>...</c> (code tags) around your example program so that it would be easier to read.
Try again by quoting the newline character, qq[\n], in your print statements.
In Section
Seekers of Perl Wisdom