in reply to Entering EXIT at any prompt
You can't do as you asked, but you can mimic the behaviour with a subroutine:
sub input { chomp( my $input = <STDIN> ); exit if $input eq "exit"; return $input; }
With that sub defined, just use my $var = input(); instead of my $var = <STDIN>;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Entering EXIT at any prompt
by trenchwar (Beadle) on Feb 08, 2008 at 00:14 UTC |