in reply to My first Script
The statement $usersex = <STDIN> stores the input typed by the user (that's good) and also includes the newline when the user hit enter (that's bad). The final string probably looks like "boy\n". This caused the statement ..
if ($usersex eq "boy")
.. to return false. Take a look at this more correct example:
print "\nAre you a boy or a girl?";
$usersex = <STDIN>;
chomp $usersex; # remove trailing newline
if ($usersex eq "boy")
{
$userboy = "he";
}
elsif ($usersex eq "girl")
{
$userboy = "she";
}
print "$userboy is a $usersex";
Also, you may consider using the uc function to make your string comparison case-insensitive. :-)
Hope this helps...