Subject: | Use prompt() in Makefile.PL to Allow Automated Tests |
Dear Ken Williams,
Hi. This is imacat from Taiwan. I found that the Makefile.PL of
Apache-SSI-2.19 goes into infinite loop if nothing is read from
keyboard. I would suggest that you use prompt() instead of directly
obtain input from the STDIN, as suggested in the ExtUtils::MakeMaker
document, so that the it won't go into infinite loop.
<<ExtUtils::MakeMaker>>
Other Handy Functions
http://search.cpan.org/perldoc?ExtUtils::MakeMaker#Other_Handy_Functions
I made a simple patch to Apache-SSI-2.19, in the hope that it helps.
Please tell me if you have any question, or if I could be of any help.
Thank you.
Subject: | Apache-SSI-2.19-prompt.diff |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
diff -u -r Apache-SSI-2.19.orig/t/lib/Apache/test.pm Apache-SSI-2.19/t/lib/Apache/test.pm
- --- Apache-SSI-2.19.orig/t/lib/Apache/test.pm 2005-01-27 12:03:09.000000000 +0800
+++ Apache-SSI-2.19/t/lib/Apache/test.pm 2008-04-02 06:34:25.000000000 +0800
@@ -5,6 +5,7 @@
use Exporter ();
use Config;
use FileHandle ();
+use ExtUtils::MakeMaker;
*import = \&Exporter::import;
@EXPORT = qw(test fetch simple_fetch have_module skip_test
@@ -93,9 +94,9 @@
my $skip = defined $canskip ? " ('$canskip' to skip)" : '';
my $response;
do {
- - print "$prompt [$default]$skip: ";
- - chomp($response = <STDIN>);
- - $response ||= $default;
+ $response = prompt("$prompt $skip:", $default);
+ $response = $canskip
+ if $mustfind && defined $canskip && $response eq $default && !-e $response;
} until (!$mustfind || ($response eq $canskip) || (-e $response || !print("$response not found\n")));
return $response;
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
iEYEARECAAYFAkfyuJQACgkQi9gubzC5S1z3RwCgldedZAjSognjikOOkpa3FcrG
t+UAn0oyqKbxaxyiioYMGlBurwbiKnBs
=kr4w
-----END PGP SIGNATURE-----