* Cahill, Earl <ecahill at corp.untd.com> [2005/03/15 14:09]:
> A start with a line, say
> 
> This line is really too long.
> 
> A length, say 25, and suffix, say '...'.  I would like to be able to do
> something like this
> 
> [% my_truncate(line, 25, '...') %]
> 
> And end up with 
> 
> This line is really t...
> 
> Just wondering if there is something out there that already does this.

The standard truncate filter does this:

  $ tpage 
  [% FILTER truncate(25) %]
  This line is really too long.
  [% END %]

  This line is really t...

See L<Template::Manual::Filters> for details.

(darren)

-- 
The secret of life is enjoying the passage of time.
    -- James Taylor

Attachment: pgp8Pycrf7g85.pgp
Description: PGP signature

Reply via email to