File: 694537-use-Scalar-Util-openhandle.patch

package info (click to toggle)
libio-prompt-perl 0.997001-1%2Bdeb7u1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 276 kB
  • sloc: perl: 846; makefile: 2
file content (23 lines) | stat: -rw-r--r-- 901 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Description: Doesn't work on 5.14 if you call prompt() in non-"main" package
Origin: upstream, https://metacpan.org/diff/file/?target=DCONWAY/IO-Prompt-0.997002/lib/IO/Prompt.pm&source=DCONWAY/IO-Prompt-0.997001/lib/IO/Prompt.pm
Bug: https://rt.cpan.org/Public/Bug/Display.html?id=69084
Bug-Debian: http://bugs.debian.org/694537
Forwarded: not-needed
Author: Salvatore Bonaccorso <carnil@debian.org>
Last-Update: 2012-11-27
Applied-Upstream: yes

--- a/lib/IO/Prompt.pm
+++ b/lib/IO/Prompt.pm
@@ -183,9 +183,10 @@
         open $IN, "</dev/tty" or croak "Cannot read from terminal: $!";
     }
     else {
+        use Scalar::Util;
         no strict 'refs';
         my $ARGV = $caller . "::ARGV";
-        unless (*$ARGV->opened) {
+        unless (Scalar::Util::openhandle(*$ARGV)) {
             $$ARGV = shift(@$ARGV) || '-';
             open $ARGV or croak "Can't open $$ARGV: $!";
         }