Rasha has asked for the wisdom of the Perl Monks concerning the following question:
Would you be so kind to let me know what's the mistake in this code? Thank you so much in advance! :)
print "please enter one character: "; $char = <>; while ($char ne ".") { if ($char eq "a") { $count++; } print "please enter one character: "; $char = <>; } print "The number of a is $count"; print "done";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl Beginner
by Marshall (Canon) on Nov 26, 2016 at 02:25 UTC | |
|
Re: Perl Beginner
by haukex (Archbishop) on Nov 26, 2016 at 09:53 UTC | |
|
Re: Perl Beginner
by tybalt89 (Monsignor) on Nov 26, 2016 at 01:34 UTC | |
|
Re: Perl Beginner ( print "please enter one character: "; $char = <>; )
by Anonymous Monk on Nov 26, 2016 at 01:34 UTC | |
|
Re: Perl Beginner (reading single keystrokes)
by LanX (Saint) on Nov 26, 2016 at 21:18 UTC |