[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]

[5.10] PATCH: Pod/Text.pm Can't call method "pod2text" without a package or object reference




ERROR CONDITION (5.10)

      Can't call method "pod2text" without a package or object reference
      at /home/jaalto/tmp/t.pl line 12.

TEST SCRIPT

    #!/usr/bin/perl

    use strict;
    use English;

    =pod

    Test POD

    =cut

    pod2text $PROGRAM_NAME;

PATCH TO FIX THIS

From 1da7675f35645fae3078ddcce9c2e54fad01df73 Mon Sep 17 00:00:00 2001
From: Jari Aalto <jari.aalto@cante.net>
Date: Tue, 16 Sep 2008 13:57:33 +0300
Subject: [PATCH] Pod/Text.pm: (output): Check undefined file descriptor.

Signed-off-by: Jari Aalto <jari.aalto@cante.net>
---
 Text.pm |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/Text.pm b/Text.pm
index 03a62bf..613b865 100644
--- a/Text.pm
+++ b/Text.pm
@@ -246,7 +246,14 @@ sub reformat {
 sub output {
     my ($self, $text) = @_;
     $text =~ tr/\240\255/ /d;
-    print { $$self{output_fh} } $text;
+
+    my $fd = $$self{output_fh};
+
+    if ( $fd ) {
+	print { $fd } $text;
+    } else {
+	print $text;
+    }
 }
 
 # Output a block of code (something that isn't part of the POD text).  Called
-- 
1.5.6.5



[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]