Re: Cookies - Basic Perl

2012-12-12 Thread Nathan Hilterbrand
Before your 2nd while loop, add: $cookie = ""; > I have a problem with a certain script, as a beginner. > > #!/usr/bin/perl -w > # > # Cookie Monster > > $cookie = ""; > > while ( $cookie ne 'cookie') { > print 'Give me a cookie: '; > chomp($cookie = ); > } > > print "Mmmm. Cookie.\n"; > > whil

Re: Cookies - Basic Perl

2012-12-12 Thread Andy Bach
On Tue, Dec 11, 2012 at 9:41 PM, Alex Ahn wrote: > Thank you all for the input on how to resolve to problem with the second > loop. Not sure if this is what you're working towards, but the problem of prompt and response is always a design decision - when you are looking to make a multiple promp

Re: Cookies - Basic Perl

2012-12-12 Thread Andy Bach
On Tue, Dec 11, 2012 at 3:47 PM, Alex Ahn wrote: > I have a problem with a certain script, as a beginner. > #!/usr/bin/perl -w # # Cookie Monster use strict; print 'Give me a cookie (q to quit): '; while ( my $cookie = <> ) { chomp($cookie); if ( $cookie eq 'cookie') {