laziness, impatience, and hubris | |
PerlMonks |
Re: New and Stumpedby kyle (Abbot) |
on Feb 11, 2008 at 04:38 UTC ( [id://667318]=note: print w/replies, xml ) | Need Help?? |
Welcome to the Monastery. Please have a look at Writeup Formatting Tips. It appears your entire question is in code tags, but only the code should be. In answer to your question, see here:
The first important change is to us "eq" when comparing strings. The "==" comparison is only for numbers. See perlop for details. The other important change is to chomp the input after you get it. Otherwise, $command will have a trailing line terminator. As an aside, if you haven't looked into them already, I recommend you use strict and warnings with everything you write. You may want to go without them later, but for now they'll probably save you more headaches than they cause.
In Section
Seekers of Perl Wisdom
|
|