Liam has asked for the wisdom of the Perl Monks concerning the following question:
Problem is $userboy should equal he or she, but it shows up as nothing! how do i fix it?#!/usr/local/bin/perl print "\nWhat is your name?"; $username = <STDIN>; print "\nWhere do you live?"; $userlocation = <STDIN>; print "\nHow old are you?"; $userage = <STDIN>; $userage2 = $userage++; print "\nAre you a boy or a girl?"; $usersex = <STDIN>; if ($usersex eq "boy") { $userboy = "he"; }elsif ($usersex eq "girl") { $userboy = "she"; } print "$username is $userage2 years old and lives in $userlocation" ." In a year $userboy will be $userage $username is a $usersex";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: My first Script
by vroom (His Eminence) on Feb 08, 2000 at 01:51 UTC | |
by setantae (Scribe) on Feb 08, 2000 at 02:12 UTC | |
|
RE: My first Script
by Anonymous Monk on Feb 08, 2000 at 04:14 UTC | |
|
Re: My first Script
by stephen (Priest) on Feb 09, 2000 at 04:46 UTC |