From 6dd43c66c0f6904edf156eb77ce4ad87e9dddf72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lesimple?= Date: Wed, 10 Jan 2024 14:29:55 +0000 Subject: [PATCH] enh: batch: openhandle() is overkill and doesn't work on EOF --- bin/plugin/open/batch | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bin/plugin/open/batch b/bin/plugin/open/batch index 54e5bdb..6cd1b45 100755 --- a/bin/plugin/open/batch +++ b/bin/plugin/open/batch @@ -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 = )) { +while ($line = ) { + last if !defined $line; # stdin has been closed chomp $line; last if (lc($line) eq 'exit' || lc($line) eq 'quit');