mirror of
https://github.com/ovh/the-bastion.git
synced 2025-01-01 13:01:53 +08:00
enh: batch: openhandle() is overkill and doesn't work on EOF
This commit is contained in:
parent
692ebca3c2
commit
6dd43c66c0
1 changed files with 2 additions and 3 deletions
|
@ -2,8 +2,6 @@
|
|||
# vim: set filetype=perl ts=4 sw=4 sts=4 et:
|
||||
use common::sense;
|
||||
|
||||
use Scalar::Util qw{ openhandle };
|
||||
|
||||
use File::Basename;
|
||||
use lib dirname(__FILE__) . '/../../../lib/perl';
|
||||
use OVH::Result;
|
||||
|
@ -51,7 +49,8 @@ osh_info "--- waiting for input";
|
|||
|
||||
my @ret;
|
||||
my $line;
|
||||
while ((openhandle(\*STDIN)) && ($line = <STDIN>)) {
|
||||
while ($line = <STDIN>) {
|
||||
last if !defined $line; # stdin has been closed
|
||||
chomp $line;
|
||||
last if (lc($line) eq 'exit' || lc($line) eq 'quit');
|
||||
|
||||
|
|
Loading…
Reference in a new issue