Re: [Templates] Can't comparing strings (strings are treated as numbers)

[prev] [thread] [next] [Date index for 2004/12/23]

From: Vivek Khera
Subject: Re: [Templates] Can't comparing strings (strings are treated as numbers)
Date: 17:42 on 23 Dec 2004
On Dec 23, 2004, at 12:42 PM, Sean T Allen wrote:

> Well that isnt a string per-se,
> its a date...
>
> pirint "good\n" if ( '2004-11-23' < '2004-11-26' );
>
> doesnt print good either...
>

Yes, but print "good\n" if ( "2004-11-23" lt "2004-11-26" ); does what 
you expect.  you can't use a numeric compare in perl for strings.  I 
don't know if TT has the necessary magic to compare as string instead 
of as numeric in the underlying perl code.



_______________________________________________
templates mailing list
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates

Re: [Templates] Can't comparing strings (strings are treated as numbers)
Vivek Khera 17:42 on 23 Dec 2004

Generated at 08:56 on 15 Mar 2005 by mariachi v0.52