Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fcm cm prompting: catch undef STDIN readline result #165

Open
benfitzpatrick opened this issue Dec 4, 2014 · 1 comment
Open

fcm cm prompting: catch undef STDIN readline result #165

benfitzpatrick opened this issue Dec 4, 2014 · 1 comment
Labels
Milestone

Comments

@benfitzpatrick
Copy link
Contributor

We have a chunk of code in lib/FCM/System/CM/Prompt.pm that looks like:

        $answer = readline(STDIN);
        chomp($answer);

This can sometimes cause an error message:

Use of uninitialized value $answer in scalar chomp

This happens when readline returns undef, and one particular case it sets $! to Resource temporarily unavailable.

This looks like a problem with non-blocking vs blocking STDIN handling, and is common to
other utilities. We can probably check for defined(answer) and exit with a better message.

@benfitzpatrick benfitzpatrick self-assigned this Dec 4, 2014
@benfitzpatrick benfitzpatrick added this to the later milestone Dec 4, 2014
@matthewrmshin
Copy link
Member

We should probably just migrate to use Perl's Term::UI, which has been part of standard Perl since 5.10.0.

@matthewrmshin matthewrmshin modified the milestones: soon, later Apr 7, 2015
@matthewrmshin matthewrmshin removed their assignment Sep 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants