Skip to content

Commit

Permalink
enh: batch: openhandle() is overkill and doesn't work on EOF
Browse files Browse the repository at this point in the history
  • Loading branch information
speed47 committed Jan 17, 2024
1 parent 692ebca commit 6dd43c6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions bin/plugin/open/batch
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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');

Expand Down

0 comments on commit 6dd43c6

Please sign in to comment.