At 02:30 PM 6/22/01 -0500, Nick Transier wrote:
>Does anyone know a way to make boolean comparisons between strings?
>For example, I want 'a' < 'b' to be true

'a' lt 'b'

>, but perl says 'a' == 'b' is true.

'a' eq 'b'  is false

'a' == 'b' is true because each string is interpreted in a numeric context 
as zero.

If you had enabled warnings (-w) it would have told you it was doing this.

Perhaps the FAQ should say: "Have you done -w and use strict?"
--
Peter Scott
Pacific Systems Design Technologies
http://www.perldebugged.com

Reply via email to