Skip Menu |

This queue is for tickets about the Pod-Parser CPAN distribution.

Report information
The Basics
Id: 69392
Status: rejected
Worked: 10 min
Priority: 0/
Queue: Pod-Parser

People
Owner: Nobody in particular
Requestors: florent.angly [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.38
Fixed in: (no value)



Subject: POD string in variables not handled properly
I have been trying to parse Perl files that contain POD with Pod::Parser. I have noticed that Pod::Parser fails to properly handle certain cases. If the Perl file contains a variable whose content is POD-formatted, then this POD will be extracted by Pod::Simple although it should not be extracted since it is not a POD section but the content of a variable. I attached a test file containing POD to reproduce the problem. Run the following and notice that a POD that should not be extracted is extracted: podselect tricky.pl The POD parsing mechanism of perltidy seems to be more robust and able to detect this variable-embedded POD. Running the following properly keeps the POD string in the file: perltidy --delete-pod tricky.pl
Subject: tricky.pl
#! /usr/bin/env perl use strict; use warnings; =head1 NAME Tricky =cut print "Starting...\n--------\n"; my $var =<<EOS; =head1 FAKE_POD_ENTRY_HERE This should not be extracted as POD since it is the content of a variable =cut EOS print $var; print "--------\nDone!\n"; exit; __END__ =head1 SYNOPSIS Tricky file to test proper POD parsing
This won't be fixed any more. Pod-Parser is going to be phased out. As a workaround, you can prefix each line of the variable text with e.g. # and then after that in the code say $var =~ s/^#//m; and you have what you want. But I encourage you to test the same thing with Pod::Simple and report the problem there if it exists. -Marek Am So 10. Jul 2011, 19:35:14, FANGLY schrieb: Show quoted text
> I have been trying to parse Perl files that contain POD with > Pod::Parser. I have noticed that Pod::Parser fails to properly handle > certain cases. If the Perl file contains a variable whose content is > POD-formatted, then this POD will be extracted by Pod::Simple although > it should not be extracted since it is not a POD section but the content > of a variable. > > I attached a test file containing POD to reproduce the problem. Run the > following and notice that a POD that should not be extracted is extracted: > podselect tricky.pl > > The POD parsing mechanism of perltidy seems to be more robust and able > to detect this variable-embedded POD. Running the following properly > keeps the POD string in the file: > perltidy --delete-pod tricky.pl