Skip Menu |

This queue is for tickets about the PPR CPAN distribution.

Report information
The Basics
Id: 132405
Status: resolved
Priority: 0/
Queue: PPR

People
Owner: Nobody in particular
Requestors: albert.tests [...] gmail.com
Cc:
AdminCc:

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



Subject: Retain newlines for POD in case of PPR::decomment
Date: Thu, 23 Apr 2020 14:15:55 +0200
To: bug-PPR [...] rt.cpan.org
From: Albert <albert.tests [...] gmail.com>
Based on my stack overflow issue (and the answer by Håkon Hægland ): https://stackoverflow.com/questions/61307663/retain-newlines-for-pod-in-case-of-ppruncomment I think it might be useful for the PPR package to have this facility as an enhancement / optional setting in PPR as well. For completeness the text from the stackoverflow issue: When using code like: ``` my $aFileData = read_file($sFilename); $aFileData =~ s/\r$//g; my @aRawFileData= split /(?<=\n)/, $aFileData; $self->{'_aRawFileData'} = \@aRawFileData; my $aUncommentFileData_tmp = PPR::decomment(join($", $aFileData)); my @aUncommentFileData = split /(?<=\n)/, $aUncommentFileData_tmp; $self->{'_aUncommentFileData'} = \@aUncommentFileData; print("@{$self->{'_aRawFileData'}}===============\n@ {$self->{'_aUncommentFileData'}}========================\n"); ``` and having input like in the file of `$sFilename`: ``` my $z=1; =head1 HEADER Just some documentation =cut my $x=7; # Just some documentation my $y=11; sub is_top_level { } ``` We see in the output that the comment lines are gone and that the POD is gone. So far so good: ``` my $z=1; my $x=7; my $y=11; sub is_top_level { } ``` one thing we see is that the POD has been replaced by just **1 line**, whilst for the comment line is replaced by an empty line. Is it possible that the POD is also replaced by empty lines (so in this case **5 lines**)? <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> Virus-free. www.avg.com <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
Subject: Re: [rt.cpan.org #132405] Retain newlines for POD in case of PPR::decomment
Date: Fri, 24 Apr 2020 04:42:39 +0000
To: bug-PPR [...] rt.cpan.org
From: Damian Conway <damian [...] conway.org>
Hi Albert, You asked: Show quoted text
> Is it possible that the POD is also replaced by empty lines (so in this > case **5 lines**)?
I have now updated the module so that newlines are always preserved in all decommented code. No extra option was needed; I simply made it the standard behaviour. The updated module (version 0.000026) was just uploaded to CPAN. Thank-you for the suggestion. Damian
Subject: Re: [rt.cpan.org #132405] Retain newlines for POD in case of PPR::decomment
Date: Fri, 24 Apr 2020 13:19:12 +0200
To: bug-PPR [...] rt.cpan.org
From: Albert <albert.tests [...] gmail.com>
Thanks for the very fast update, just tested it and as far as I can see works as expected. It is unexpected, but highly appreciated that this is now default behavior. <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> Virus-free. www.avg.com <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> On Fri, Apr 24, 2020 at 6:43 AM damian@conway.org via RT < bug-PPR@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=132405 > > > Hi Albert, > > You asked: >
> > Is it possible that the POD is also replaced by empty lines (so in this > > case **5 lines**)?
> > I have now updated the module so that newlines are always preserved > in all decommented code. No extra option was needed; I simply made it > the standard behaviour. > > The updated module (version 0.000026) was just uploaded to CPAN. > > Thank-you for the suggestion. > > Damian > >