MSPM5 has asked for the wisdom of the Perl Monks concerning the following question:
When typing == i always got "good choice" but when i typing "eq" always print bad choice
#!/usr/bin/perl print "what is your name\n"; $name = <STDIN>; print "hello $name"; print "select letter\n"; $select = <STDIN>; if ($select == a) { print "good choice\n"; } else { print "bad choice\n"; }
I wanna do something like if i type "a" print good choice else bad choice but i don't know where the problem is ?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: What i doing wrong
by stevieb (Canon) on Apr 01, 2012 at 20:29 UTC | |
|
Re: What i doing wrong
by toolic (Bishop) on Apr 01, 2012 at 22:09 UTC | |
by JavaFan (Canon) on Apr 01, 2012 at 23:00 UTC | |
by Lotus1 (Vicar) on Apr 02, 2012 at 01:22 UTC |