in reply to My first Script

Your problem is that when you read in from the keyboard you get the "\n" (newline) as well. You can chomp that variable in yourcase $usersex, like chomp $usersex and it should work.

Replies are listed 'Best First'.
RE: RE: My first Script
by setantae (Scribe) on Feb 08, 2000 at 02:12 UTC
    To clarify what vroom has said, change your lines so that where you are asking for input you have (for example):chomp ($usersex = <STDIN>);This will also prevent the output looking like this:
    setantae is 23 years old and lives in Wales In a year will be 24 setantae is a boy
    $userboy will still show up as nothing unless the user enters exactly boy or girl. You may also want to check for more common user input, such as b, g, Boy, BOY, etc.
    setantae@eidosnet.co.uk|setantae|http://www.setantae.uklinux.net