rcd^_- has asked for the wisdom of the Perl Monks concerning the following question:
Hello, I'm very new to perl and put this together real fast... I spent about 100 times as much effort trying to get it to work as I did typing it... help me ploxx? ^^
#!perl print "What is your name?\n"; chomp($name = <STDIN>); if ($name = 'larry') { print "You\'re Larry!\n" } elsif ($name = 'moe') { print "You\'re Moe!\n" } elsif ($name = 'curly') { print "You\'re Curly!\n" }
whenever I run it and enter an name it always comes back larry... I'm sure there's some glaring mistake that I've made but i cant find it.... -.- ty in advance.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: elsif failing
by GrandFather (Saint) on Sep 22, 2009 at 04:46 UTC | |
|
Re: elsif failing
by lamprecht (Friar) on Sep 22, 2009 at 04:31 UTC | |
|
Re: elsif failing
by biohisham (Priest) on Sep 22, 2009 at 06:11 UTC | |
by GrandFather (Saint) on Sep 22, 2009 at 07:11 UTC |