diff --git a/bin/plugin/open/batch b/bin/plugin/open/batch index 7e969fb..54e5bdb 100755 --- a/bin/plugin/open/batch +++ b/bin/plugin/open/batch @@ -2,6 +2,8 @@ # 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; @@ -48,7 +50,8 @@ osh_info "Use 'exit', 'quit' or ^D to stop."; osh_info "--- waiting for input"; my @ret; -while (my $line = ) { +my $line; +while ((openhandle(\*STDIN)) && ($line = )) { chomp $line; last if (lc($line) eq 'exit' || lc($line) eq 'quit');