Closed p5pRT closed 16 years ago
When using the Text::Parsewords module\, and quotewords\, it will die when it encounters a really long string of text. Here is an example script. Increase the "7" in "$num \< 7" to force it to crash.
#!/usr/local/bin/perl -w # Generates a line "Section One"\,"01234567890123456789...etc" use Text::ParseWords; my $line = "\"Section One\"\,\""; # "Section One"\," my $total = 0; my $num = 0; my $tens = 0; while ( $tens \< 3276 ) { $line .= $num; # append the number 0-9 to end of string $num++; $total++; if ( $num > 9 ) { $tens++; # increase the tens by one $num = 0; # reset the numbers back to zero. } } # repeat until you have added 32760 characters while ( $num \< 7 ) { $line .= $num; # append the numbers 0-7\, to push it over the edge $num++; $total++; } $line .= "\""; # put closing quote at end of string. print "TOTAL characters: $total\n"; my @Test = "ewords('\,'\, 0\, $line) or die "Cannot quotewords: $!\n";
On Mon Apr 02 10:57:59 2007\, ruddatwork \<!-- x --> at yahoo.com wrote:
When using the Text::Parsewords module\, and quotewords\, it will die when it encounters a really long string of text. Here is an example script. Increase the "7" in "$num \< 7" to force it to crash.
#!/usr/local/bin/perl -w # Generates a line "Section One"\,"01234567890123456789...etc" use Text::ParseWords; my $line = "\"Section One\"\,\""; # "Section One"\," my $total = 0; my $num = 0; my $tens = 0; while ( $tens \< 3276 ) { $line .= $num; # append the number 0-9 to end of string $num++; $total++; if ( $num > 9 ) { $tens++; # increase the tens by one $num = 0; # reset the numbers back to zero. } } # repeat until you have added 32760 characters while ( $num \< 7 ) { $line .= $num; # append the numbers 0-7\, to push it over the edge $num++; $total++; } $line .= "\""; # put closing quote at end of string. print "TOTAL characters: $total\n"; my @Test = "ewords('\,'\, 0\, $line) or die "Cannot quotewords: $!\n";
Yes\, this blows up with bleadperl....
[steve@sulu perl-current]$ /tmp/bleadperl/bin/perl5.9.5 foo.pl TOTAL characters: 32767 Complex regular subexpression recursion limit (32766) exceeded at /tmp/bleadperl/lib/5.9.5/Text/ParseWords.pm line 64.
The RT System itself - Status changed from 'new' to 'open'
On Mon Apr 02 10:57:59 2007\, ruddatwork@yahoo.com wrote:
When using the Text::Parsewords module\, and quotewords\, it will die when it encounters a really long string of text. Here is an example script. Increase the "7" in "$num \< 7" to force it to crash.
This seems to be fixed in perl 5.10.0.
Kind regards\,
Bram
p5p@spam.wizbit.be - Status changed from 'open' to 'resolved'
Migrated from rt.perl.org#42276 (status was 'resolved')
Searchable as RT42276$