diff options
author | Salvatore Bonaccorso <carnil@debian.org> | 2015-07-23 19:55:11 +0200 |
---|---|---|
committer | Salvatore Bonaccorso <carnil@debian.org> | 2015-07-23 19:55:11 +0200 |
commit | 5b196d0dd4977f5ad95fcb6fa7a48e535621e0c0 (patch) | |
tree | 382282ebe55bef7c4ef61ce7a236e257ef23170f | |
parent | bff5a1697014f23d0161880c95a042a552d10c28 (diff) | |
parent | bf857760989701553afb5c450eced3f708a0ba78 (diff) |
Merge tag 'upstream/0.004013'
Upstream version 0.004013
-rw-r--r-- | Changes | 8 | ||||
-rw-r--r-- | META.json | 4 | ||||
-rw-r--r-- | META.yml | 4 | ||||
-rw-r--r-- | README | 2 | ||||
-rw-r--r-- | lib/IO/Prompter.pm | 8 |
5 files changed, 17 insertions, 9 deletions
@@ -166,3 +166,11 @@ Revision history for IO-Prompter * Handle terminal escape sequences (e.g. arrow keys) more gracefully (Thanks, Lukasz!) + + +0.004013 Thu Jul 23 07:15:57 2015 + + * Added better default ERASE character for MSWin32 (thanks Dan!) + + * Silenced warnings within test for valid input + (Thanks Joel!) @@ -4,7 +4,7 @@ "Damian Conway <DCONWAY@CPAN.org>" ], "dynamic_config" : 1, - "generated_by" : "ExtUtils::MakeMaker version 7.02, CPAN::Meta::Converter version 2.142690", + "generated_by" : "ExtUtils::MakeMaker version 7.04, CPAN::Meta::Converter version 2.142690", "license" : [ "perl_5" ], @@ -38,5 +38,5 @@ } }, "release_status" : "stable", - "version" : "0.004012" + "version" : "0.004013" } @@ -7,7 +7,7 @@ build_requires: configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 1 -generated_by: 'ExtUtils::MakeMaker version 7.02, CPAN::Meta::Converter version 2.142690' +generated_by: 'ExtUtils::MakeMaker version 7.04, CPAN::Meta::Converter version 2.142690' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -20,4 +20,4 @@ no_index: requires: Contextual::Return: '0' Test::More: '0' -version: '0.004012' +version: '0.004013' @@ -1,4 +1,4 @@ -IO::Prompter version 0.004012 +IO::Prompter version 0.004013 Prompt for, read, vet, chomp, and encapsulate input. Like so: diff --git a/lib/IO/Prompter.pm b/lib/IO/Prompter.pm index 96987fc..4626324 100644 --- a/lib/IO/Prompter.pm +++ b/lib/IO/Prompter.pm @@ -9,7 +9,7 @@ use Contextual::Return qw< PUREBOOL BOOL SCALAR METHOD VOID LIST RETOBJ >; use Scalar::Util qw< openhandle looks_like_number >; use Symbol qw< qualify_to_ref >; -our $VERSION = '0.004012'; +our $VERSION = '0.004013'; my $fake_input; # Flag that we're faking input from the source @@ -938,7 +938,7 @@ sub _verify_input_constraints { CONSTRAINT: for my $msg (@constraints) { my $constraint = $constraint_for{$msg}; - next CONSTRAINT if eval { local $_ = $input; $input ~~ $constraint; }; + next CONSTRAINT if eval { no warnings; local $_ = $input; $input ~~ $constraint; }; $failed = $msg =~ m{\A [[:upper:]] }xms ? "$msg " : $msg =~ m{\A \W }xms ? $opt_ref->{-prompt} . "$msg " @@ -1180,7 +1180,7 @@ sub _generate_unbuffered_reader_from { $ctrl{EOF} //= "\4"; $ctrl{INTERRUPT} //= "\3"; - $ctrl{ERASE} //= "\177"; + $ctrl{ERASE} //= $^O eq 'MSWin32' ? "\10" : "0177"; my $ctrl = join '|', values %ctrl; @@ -1718,7 +1718,7 @@ IO::Prompter - Prompt for input, read it, clean it, return it. =head1 VERSION -This document describes IO::Prompter version 0.004012 +This document describes IO::Prompter version 0.004013 =head1 SYNOPSIS |