X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=utils%2Fperldoc.PL;h=7dc478b4e78e10b1d408dcbe3344ed2544ced61a;hb=fcbfa962e80dc16f8db1afaeb5287e8a393d3942;hp=bd233504821579cad7b78b6e53e691b9a88065f2;hpb=febd60db78d69754497d8360da8c221b5cd2747b;p=p5sagit%2Fp5-mst-13.2.git diff --git a/utils/perldoc.PL b/utils/perldoc.PL index bd23350..7dc478b 100644 --- a/utils/perldoc.PL +++ b/utils/perldoc.PL @@ -142,7 +142,10 @@ if ($opt_X) { if ((my $opts = do{ local $^W; $opt_t + $opt_u + $opt_m + $opt_l }) > 1) { usage("only one of -t, -u, -m or -l") } -elsif ($Is_MSWin32 || $Is_Dos) { +elsif ($Is_MSWin32 + || $Is_Dos + || !(exists $ENV{TERM} && $ENV{TERM} !~ /dumb|emacs|none|unknown/i)) +{ $opt_t = 1 unless $opts } @@ -310,10 +313,9 @@ sub printout { my $err; if ($opt_t) { - open(TMP,">>$tmp") - or warn("Can't open $tmp: $!"), return; - Pod::Text::pod2text($file,*TMP); - close TMP; + open(OUT,">>$tmp") or warn("Can't open $tmp: $!"), return; + Pod::Text->new()->parse_from_file($file,\*OUT); + close OUT; } elsif (not $opt_u) { my $cmd = "pod2man --lax $file | nroff -man";