That may explains sprintf error message, but not the endless loop. Observe
##!/usr/bin/perl -T package MySpell; =head1 NAME =head1 THE EMAN =head1 THENAMEISLONGANDLONGITSLONG thename =cut use Pod::Spell(); @ISA = qw' Pod::Spell '; use strict; use warnings; sub warp(@) { my( %carettable ) = ( map { chr($_) => '^'.chr(64+$_) } 0 ..31 ); my (@f) = @_; for my $f (@f) { $f =~ s/([[:cntrl:]])/$carettable{$1}/g; } print @f, sprintf qq! at %s line %d.\n!, (caller)[ 1, 2 ]; } sub _treat_words { my $p = shift; my $i = 0; my $word = ""; while ( $_[0] =~ m<(\S+)>g ) { ++$i; $word = $1; warp "i($i)word($word) 1($1)"; if( $i > 2){ warp "Bailing out i $i"; last; } } } package main; MySpell->new->parse_from_file( __FILE__ ); __END__ perl temp.pl perl -T temp.pl D:\> D:\>perl temp.pl i(1)word(NAME) 1(NAME) at temp.pl line 40. i(1)word(THE) 1(THE) at temp.pl line 40. i(2)word(EMAN) 1(EMAN) at temp.pl line 40. i(1)word(THENAMEISLONGANDLONGITSLONG) 1(THENAMEISLONGANDLONGITSLONG) a +t temp.pl line 40. i(1)word(thename) 1(thename) at temp.pl line 40. D:\>perl -T temp.pl i(1)word(=^@9^@) 1(=^@9^@) at temp.pl line 40. i(2)word(NAME) 1(NAME) at temp.pl line 40. i(3)word(NAME) 1(NAME) at temp.pl line 40. Bailing out i 3 at temp.pl line 42. i(1)word(THE) 1(THE) at temp.pl line 40. i(2)word(THE) 1(THE) at temp.pl line 40. i(3)word(THE) 1(THE) at temp.pl line 40. Bailing out i 3 at temp.pl line 42. i(1)word(THENAMEISLONGANDLONGITSLONG) 1(THENAMEISLONGANDLONGITSLONG) a +t temp.pl line 40. i(2)word(THENAMEISLONGANDLONGITSLONG) 1(THENAMEISLONGANDLONGITSLONG) a +t temp.pl line 40. i(3)word(THENAMEISLONGANDLONGITSLONG) 1(THENAMEISLONGANDLONGITSLONG) a +t temp.pl line 40. Bailing out i 3 at temp.pl line 42. i(1)word(thename) 1(thename) at temp.pl line 40. i(2)word(thename) 1(thename) at temp.pl line 40. i(3)word(thename) 1(thename) at temp.pl line 40. Bailing out i 3 at temp.pl line 42. D:\>
I think its the same bug in perl as #27344: pos() does not get updated when running in taint mode

In reply to Re^2: endless loop in Pod::Spell? by Anonymous Monk
in thread endless loop in Pod::Spell? by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.