Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
so I am doing something like this
print "Please press enter to quit \n"; my $fi = <STDIN>; chomp $fi; if ($fi eq \n ) { exit; } else { while ($fi) { print "Please press enter to quit \n"; $fi = <STDIN>; chomp $fi; if ($fi eq \n ) { exit() } } }
but it is not working because i presume this command
is wrong , so can anyone tell me its alternativeif ($fi eq \n )
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Press enter to exit
by McA (Priest) on Jul 27, 2013 at 06:26 UTC | |
|
Re: Press enter to exit
by kcott (Archbishop) on Jul 27, 2013 at 08:52 UTC | |
|
Re: Press enter to exit
by 2teez (Vicar) on Jul 27, 2013 at 10:19 UTC | |
|
Re: Press enter to exit
by hippo (Archbishop) on Jul 27, 2013 at 09:31 UTC | |
by 2teez (Vicar) on Jul 27, 2013 at 09:45 UTC | |
|
Re: Press enter to exit
by zork42 (Monk) on Jul 28, 2013 at 05:50 UTC |