[Templates] loop first, loop last in current version

2008-09-15 Thread Birgit Kellner
Hi, in an older version of the Template Toolkit (we just updated our server to 2.19), using <% if loop.last %> threw an error that could be solved through a hack in Iterator.pm, sub AUTOLOAD: $item = 'LAST' if $item eq 'loop_final'; This hack no longer works, and <%if loop.last %> still throws

Re: [Templates] loop first, loop last in current version

2008-09-15 Thread Mike South
On Mon, Sep 15, 2008 at 9:29 AM, Birgit Kellner <[EMAIL PROTECTED]> wrote: > Hi, > > in an older version of the Template Toolkit (we just updated our server > to 2.19), using <% if loop.last %> threw an error that could be solved > through a hack in Iterator.pm, sub AUTOLOAD: > > $item = 'LAST' if

Re: [Templates] loop first, loop last in current version

2008-09-21 Thread Sean McAfee
On Mon, Sep 15, 2008 at 6:29 AM, Birgit Kellner <[EMAIL PROTECTED] > wrote: > Hi, > > in an older version of the Template Toolkit (we just updated our server > to 2.19), using <% if loop.last %> threw an error that could be solved > through a hack in Iterator.pm, sub AUTOLOAD: > > $item = 'LAST' i

Re: [Templates] loop first, loop last in current version

2008-09-22 Thread Andy Wardley
Sean McAfee wrote: > sub tokenise_directive { > my $self = shift; > my $tokens = $self->SUPER::tokenise_directive(@_); > for (my $i = 0; $i < @$tokens; $i += 2) { > if ($tokens->[$i] eq 'LAST' && $i > 0 && $tokens->[$i-2] eq 'DOT') { > splice @$tokens, $i, 2, 'IDENT', 'last'; >