Whoops, missing a CORE::
> 
> sub truncate {
>     my ($self,$max,$suffix,$min) = @_;
>     
>     return $self unless defined $max;
>     
>     $suffix||='';
>     my $string = $self->{ text };
>     return $self if CORE::length $string < $max;
>     
      $max-=CORE::length($suffix); 

>     $max = 0 if $max < 0;
>     unless ($min && $string=~s/^(.{$min,$max})\s.*/$1/e) {
>         $string = CORE::substr($string,0,$max);
>     }
>     $self-> { text } = $string.$suffix;
>     return $self;
> } 




_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to