Skip Menu |

This queue is for tickets about the PodToHTML CPAN distribution.

Report information
The Basics
Id: 8705
Status: resolved
Priority: 0/
Queue: PodToHTML

People
Owner: Nobody in particular
Requestors: mark [...] summersault.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.05
Fixed in: (no value)

Attachments
patch_PodToHTML_module.gz



Subject: fails with: Undefined subroutine &main::contains_pod called at /usr/bin/podtohtml line 51.
I installed .05 through CPAN.pm. Although it passed 'test', the podtohtml fix can't find the modules it needs: [mark@asana mech_cvs]$ podtohtml lib/WWW/Mechanize.pm Undefined subroutine &main::contains_pod called at /usr/bin/podtohtml line 51. at /usr/bin/podtohtml line 51
From: tima
I'm having similar issues and dug a bit deeper. The Pod::Parser packages (which I also have installed) has a Pod::Find module of its own. The interface on that modules is completely different then the one podtohtml expects and therefore fails. With a few quick hacks -- renaming Pod::Find to Pod::Finder and calling it in podtohtml it runs fine now on my system..
[TIMA - Wed Jan 19 17:15:03 2005]: Show quoted text
> I'm having similar issues and dug a bit deeper. The Pod::Parser > packages (which I also have > installed) has a Pod::Find module of its own.
What does that one do? Show quoted text
>The interface on that > modules is completely > different then the one podtohtml expects and therefore fails. With a > few quick hacks -- > renaming Pod::Find to Pod::Finder and calling it in podtohtml it runs > fine now on my system..
If you are on UNIX or cygwin or similar can you do diff -rub .../mydistribution .../yourhackedversion > patch and send / post the resulting patch?
Sorry, one of my spam filters must have eaten the notification as I did not know you had ever replied until now. I don't think a diff will help. All I did was name your Pod::Find module Pod::Finder (package name and file name) and modified pod2html to load Pod::Finder. The problem Markstos reported and I verified is that the Pod::Parser distribution also contains a Pod::Find module with a completely different interface from yours: http://search.cpan.org/~marekr/Pod-Parser-1.30/lib/Pod/Find.pm If you have installed both, like I have, one clobbers the other and its all downhill from there. <tim/>
From: perlspinr=XfrvlLN1Pqtfpb/ySbbPhw [...] public.gmane.org
[NI-S - Thu Jan 20 03:37:13 2005] wrote: Show quoted text
> If you are on UNIX or cygwin or similar can you do > diff -rub .../mydistribution .../yourhackedversion > patch > and send / post the resulting patch?
As TIMA (that's _not_ me) wrote, the suggested repair involves removal / creation of files. I prepared a patch using JV's 'makepatch' tool (probably overkill for this, but ..). As I write I am testing the patched distribution on cygwin and on OpenBSD (later, GNU/Linux too), but the prerequisite modules missing for me are slowling that down and my time is running short. I believe that the patch will work, though; it applies cleanly at least. Whether other issues will be encountered is another matter. Hope this helps. # This is a patch for PodToHTML-0.05 to update it to PodToHTML_NIS_fixed # # To apply this patch: # STEP 1: Chdir to the source directory. # STEP 2: Run the 'applypatch' program with this patch file as input. # # If you do not have 'applypatch', it is part of the 'makepatch' package # that you can fetch from the Comprehensive Perl Archive Network: # http://www.perl.com/CPAN/authors/Johan_Vromans/makepatch-x.y.tar.gz # In the above URL, 'x' should be 2 or higher. # # To apply this patch without the use of 'applypatch': # STEP 1: Chdir to the source directory. # If you have a decent Bourne-type shell: # STEP 2: Run the shell with this file as input. # If you don't have such a shell, you may need to manually create/delete # the files as shown below. # STEP 3: Run the 'patch' program with this file as input. # # These are the commands needed to create/delete files/directories: # rm -f 'Pod/Find.pm' touch 'Pod/Finder.pm' chmod 0555 'Pod/Finder.pm' # # This command terminates the shell and need not be executed manually. exit # #### End of Preamble #### #### Patch data follows #### diff -c 'PodToHTML-0.05/MANIFEST' 'PodToHTML_NIS_fixed/MANIFEST' Index: ./MANIFEST *** ./MANIFEST Sun Jun 20 17:20:51 2004 --- ./MANIFEST Fri Jun 24 05:19:43 2005 *************** *** 1,7 **** MANIFEST MANIFEST.SKIP Makefile.PL ! Pod/Find.pm Pod/HTML_Elements.pm Pod/Links.pm README --- 1,7 ---- MANIFEST MANIFEST.SKIP Makefile.PL ! Pod/Finder.pm Pod/HTML_Elements.pm Pod/Links.pm README diff -c /dev/null 'PodToHTML_NIS_fixed/Pod/Finder.pm' Index: ./Pod/Finder.pm *** ./Pod/Finder.pm Wed Dec 31 19:00:00 1969 --- ./Pod/Finder.pm Fri Jun 24 05:20:29 2005 *************** *** 0 **** --- 1,72 ---- + package Pod::Finder; + use Exporter; + use File::Find; + + @ISA = qw(Exporter); + @EXPORT = qw(find_pods contains_pod); + + use strict; + use vars qw(%seen_file @pod_files); + + sub find_pods + { + local %seen_file; + local @pod_files; + find( \&pod_finder, @_); + return @pod_files; + } + + sub pod_finder + { + unless ($seen_file{$File::Find::name}) + { + my $is_pod = 0; + if (/\.(?:pm|pod|pl)$/i || (-f $_ && -x _ && -T _)) + { + $is_pod = contains_pod($_) + } + + push(@pod_files,$File::Find::name) if ($seen_file{$File::Find:: name} = $is_pod); + + if (-d $_) + { + if (/^(\d+\.[\d_]+)$/) + { + unless (eval "$1" == $]) + { + $File::Find::prune = 1; + warn "perl$] skipping $File::Find::name/...\n"; + return; + } + } + } + } + } + + sub contains_pod + { + my $file = shift; + local $/ = ''; + my $pod = 0; + if (open(POD,"<$file")) + { + local $_; + while (<POD>) + { + if ($pod = /^=head\d\s/) + { + last; + } + } + close(POD); + } + else + { + warn "Cannot open $file:$!\n"; + } + return $pod; + } + + + 1; + __END__ diff -c 'PodToHTML-0.05/findpods' 'PodToHTML_NIS_fixed/findpods' Index: ./findpods *** ./findpods Sun Jun 20 17:20:51 2004 --- ./findpods Fri Jun 24 05:22:01 2005 *************** *** 3,9 **** use Config; use Carp; use Pod::Links; ! use Pod::Find; $SIG{'INT'} = \&Carp::confess; --- 3,9 ---- use Config; use Carp; use Pod::Links; ! use Pod::Finder; $SIG{'INT'} = \&Carp::confess; diff -c 'PodToHTML-0.05/podtohtml' 'PodToHTML_NIS_fixed/podtohtml' Index: ./podtohtml *** ./podtohtml Sun Jun 20 17:20:51 2004 --- ./podtohtml Fri Jun 24 05:21:37 2005 *************** *** 1,7 **** #!/usr/local/bin/new/perl -w use 5.004; use strict; ! use Pod::Find; use Pod::Links; use Pod::Usage; use Pod::HTML_Elements; --- 1,7 ---- #!/usr/local/bin/new/perl -w use 5.004; use strict; ! use Pod::Finder; use Pod::Links; use Pod::Usage; use Pod::HTML_Elements; *************** *** 180,187 **** =item -I ! Search perl's C<@INC> for pods. Heuristics implemented in L<Pod::Find> ! attempt to restrict search to files related to the version of perl executing the script. =item -S --- 180,187 ---- =item -I ! Search perl's C<@INC> for pods. Heuristics implemented in L<Pod:: Show quoted text
Finder>
! attempt to restrict search only to files related to the version of perl executing the script. =item -S #### End of Patch data #### #### ApplyPatch data follows #### # Data version : 1.0 # Date generated : Sun Jun 26 02:57:48 2005 # Generated by : makepatch 2.00_12* # Recurse directories : Yes # Excluded files : (\A|/).*\~\Z # (\A|/).*\.a\Z # (\A|/).*\.bak\Z # (\A|/).*\.BAK\Z # (\A|/).*\.elc\Z # (\A|/).*\.exe\Z # (\A|/).*\.gz\Z # (\A|/).*\.ln\Z # (\A|/).*\.o\Z # (\A|/).*\.obj\Z # (\A|/).*\.olb\Z # (\A|/).*\.old\Z # (\A|/).*\.orig\Z # (\A|/).*\.rej\Z # (\A|/).*\.so\Z # (\A|/).*\.Z\Z # (\A|/)\.del\-.*\Z # (\A|/)\.make\.state\Z # (\A|/)\.nse_depinfo\Z # (\A|/)core\Z # (\A|/)tags\Z # (\A|/)TAGS\Z # r 'Pod/Find.pm' 1225 0 # p 'MANIFEST' 161 1119604783 0100500 # c 'Pod/Finder.pm' 0 1119604829 0100555 # p 'findpods' 1001 1119604921 0100555 # p 'podtohtml' 4948 1119604897 0100555 #### End of ApplyPatch data #### #### End of Patch kit [created: Sun Jun 26 02:57:48 2005] #### #### Patch checksum: 199 4723 44232 #### #### Checksum: 230 5829 6160 #### -- Also email <perlspinr=XfrvlLN1Pqtfpb/ySbbPhw@public.gmane.org>.
Download patch_PodToHTML_module.gz
application/x-gzip 1.9k

Message body not shown because it is not plain text.

Fixed in 0.06