Skip Menu |

This queue is for tickets about the Term-Prompt CPAN distribution.

Report information
The Basics
Id: 34462
Status: new
Priority: 0/
Queue: Term-Prompt

People
Owner: Nobody in particular
Requestors: kevin.ruscoe [...] ubs.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.04
Fixed in: (no value)



Subject: Non-interactive use of prompt() causes 'Use of uninitialized value' warnings
An application which is intended to be run interactively was recently invoked (by accident) non-interactively (from within a shell script). This resulted in Perl warnings from Term::Prompt. It would be better if Term::Prompt handled this silently (e.g. only chomping if the input string is defined). The behaviour can be repeated with the following code: $ cat prompt.sh #!/bin/sh perl -MTerm::Prompt -e 'prompt("y", "?", "y|n", "")' $ cat /dev/null |./prompt.sh Use of uninitialized value in scalar chomp at .../lib/Term/Prompt.pm line 254. Use of uninitialized value in substitution (s///) at .../lib/Term/Prompt.pm line 256. Use of uninitialized value in substitution (s///) at .../lib/Term/Prompt.pm line 256.