Chris And Madonna Stalnaker wrote: > > I have to start somewhere, When you read from STDIN on a terminal or console the line ends with a newline (\n) so you have to remove it.
> This works: > > print "Enter your name: "; > $text = <STDIN>; chomp( $text = <STDIN> ); > print "\nHello $text\n"; > print "Please enter your password: "; > $password = <STDIN>; chomp( $password = <STDIN> ); > if ($password == 21) > { > print"Correct\n"; > } > else > { > print "wrong\n"; > } > > This doesn't: > > print "Enter your name: "; > $text = <STDIN>; chomp( $text = <STDIN> ); > print "\nHello $text\n"; > print "Please enter your password: "; > $password eq <STDIN>; chomp( $password = <STDIN> ); > if ($password eq qwert) if ($password eq 'qwert') > { > print"Correct\n"; > } > else > { > print "wrong\n"; > } > > Why? > > if anyone replies Thank you, (flames expected!!) You're welcome. John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]