Skip Menu |

This queue is for tickets about the Text-Elide CPAN distribution.

Report information
The Basics
Id: 63858
Status: new
Priority: 0/
Queue: Text-Elide

People
Owner: Nobody in particular
Requestors: rhesa [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: v0.0.3
Fixed in: (no value)



Subject: infinite loop with certain inputs
This never returns: perl -MText::Elide=elide -E 'say elide(shift,16)' "terrifyingly, a large dog elided my string" This fixes it: diff --git a/Elide.pm b/Elide.pm index e797cdd..9ad7b11 100644 --- a/Elide.pm +++ b/Elide.pm @@ -68,7 +68,7 @@ sub elide { ### require: length( $string ) + length( $elipsis ) > $length ### require: $string =~ /\s+\S+/ - $string =~ s/\s+\S+$//; + $string =~ s/\s+\S+$// or last; ### require: length( $string ) > 0 } ### require: length( $string ) + length( $elipsis ) <= $length