It's trying to read from /dev/tty. You'll either need to run it using something like Expect and feed it via a PTY, or change your code to behave differently depending on where STDIN is coming from.
my $get_a_line = -t STDIN ? sub { readline( $_[0] ) } : sub { scalar <STDIN> }; ## . . . my $input $get_a_line->( $prompt );
In reply to Re: Term::Readline won't accept redirected input
by Fletch
in thread Term::Readline won't accept redirected input
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |