On Tue, 19 Jun 2001, Mark Fowler wrote:

> Also I'd like to re-raise the simple issue of not being able to replace
> parts of a scalar with the empty string using the replace virtual method
> that I mentioned (and patched) in:
>
> http://www.template-toolkit.org/pipermail/templates/2001-May/000952.html
>
> The TODO list should probably also mention that, as Leon said, there is a
> test that checks that this works and (wrongly!) passes, indicating there
> is something wrong with the test suite.
>

Gah, don't send there you silly mail client.  Note to self: That's the
send key, not the postpone one.

What I was going to say is that though the new version of Stash deals with
most of these issues, it's still checking for trueness (rather than
defined-ness) of the search pattern when replacing and not doing the
replace if this isn't true.  Which means I can't do this:

[% bob = "0" %]
bob: [% bob.replace('0','') %]   # returns '0' not ''

Or for that matter

[% wibble = "hi" %]
wibble: [% wibble.replace('',"So: ") %]  # returns 'hi' not 'So: hi'

Hope this makes sense...

Later.

Mark.

-- 
s''  Mark Fowler                Technology Developer         Profero Ltd
     http://www.profero.com/      [EMAIL PROTECTED]         020 7700 9960
';use Term'Cap;$t=Tgetent Term'Cap{};print$t->Tputs(cl);for$w(split/  +/
){for(0..30){$|=print$t->Tgoto(cm,$_,$y)." $w";select$k,$k,$k,.03}$y+=2}



Reply via email to