develooper Front page | perl.perl5.porters | Postings from May 2012

[perl #7834] re's in 5.7.2 breaks pod2text - pod2text -o pod/psed.pod

Thread Next
From:
James E Keenan via RT
Date:
May 1, 2012 17:53
Subject:
[perl #7834] re's in 5.7.2 breaks pod2text - pod2text -o pod/psed.pod
Message ID:
rt-3.6.HEAD-4610-1335919994-737.7834-15-0@perl.org
On Mon Oct 22 04:38:26 2001, dcd@tc.fluke.com wrote:
> 
> -----------------------------------------------------------------
> [Please enter your report here]
> 
> I thought I found an infinite loop when I tried to run
>  pod2text -o pod/psed.pod
> from within the perl-current directory
> 
> The =item and following paragraph confuses
>    Pod::Text::Overstrike::wrap()
> 
> =item [2addr]B<s/>I<regular expression>B</>I<replacement>B</>I<flags>
> 
> The length of the string (121) causes the regular expression
> to take an extremely long time to finish
> 
> $_ = "[2addr]s\cHs/\cH/_\cHr_\cHe_\cHg_\cHu_\cHl_\cHa_\cHr_\cH
>    _\cHe_\cHx_".
>        
"\cHp_\cHr_\cHe_\cHs_\cHs_\cHi_\cHo_\cHn/\cH/_\cHr_\cHe_\cHp_\cHl_".
>        
"\cHa_\cHc_\cHe_\cHm_\cHe_\cHn_\cHt/\cH/_\cHf_\cHl_\cHa_\cHg_\cHs";
> 
> /^((?:(?:[^\n]\cH)?[^\n]){0,72})\s+/;
> 
> Since perl-current contains both
>   pod2text and pod/psed.pod
> I would hope that re in Pod::Text::Overstrike::wrap()
> could be simplified.  (When the length of the string
> is 108 the re match takes over 4 minutes on my computer, so
> I hope it will finish the whole string by the end of the day,
> as it appears to be worse than O(n**2)  :-)
> 
> Since Perl 5.6.0 didn't doesn't exhibit this problem it
> would seem better to me that perl's core re processing
> should be fixed.
> 
> 

Reviewing this older ticket tonight, I cannot find pod/psed.pod in the
current blead distribution.  (In fact, I had to conduct an internet
search to even find out what psed was!)  The description of s2p and psed
in pod/perlutils.pod doesn't have any of the text cited in the original
post.  Nor could I find similar text in 'man s2p'.

So my hunch is that this issue disappeared whenever pod/psed.pod did. 
Anyone else have any thoughts on this?

Thank you very much.
Jim Keenan

---
via perlbug:  queue: perl5 status: open
https://rt.perl.org:443/rt3/Ticket/Display.html?id=7834

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About