http://www.perlmonks.org?node_id=957473


in reply to Re^4: Definition of numerically equal and rationale for 'you' == 'me'
in thread Definition of numerically equal and rationale for 'you' == 'me'

I get exactly the opposite results under 5.8.8 and 5.8.9, hpux, msys, and windows. One such example:

$ perl -e "print \"true\" if 'informal'== 'formal'" true

Update: Under strawberry 5.14.2 MSWin32-x86-multi-thread, the results are different:

$ /c/perl/strawberry/perl/bin/perl -e "print \"true\" if 'informal'!= +'formal'" true $ /c/perl/strawberry/perl/bin/perl -e "print \"true\" if 'informal'== +'formal'"

Update: Ahhhh! Very sneaky :-).

--MidLifeXis

Replies are listed 'Best First'.
Re^6: Definition of numerically equal and rationale for 'you' == 'me'
by syphilis (Archbishop) on Mar 02, 2012 at 23:43 UTC
    I get exactly the opposite results under 5.8.8 and 5.8.9, hpux, msys, and windows

    The compiler that was used to build perl affects the behaviour.
    On Windows, ActivePerl (built using Microsoft Compilers) apparently doesn't display the behaviour, but MinGW-built perls do.
    And I think there's a fairly recent perl that throws another spanner in the works by asserting (incorrectly) that nan==nan is true.

    I'm surprised that hpux and msys make a liar out of me with 5.8.9. On my linux box (an old Mandrake-9.1), behaviour is as I asserted with 5.8.9 onwards.

    Cheers,
    Rob

      (unvalidated - apply salt blocks as necessary) I wonder if this is an aton atoi feature. Version of the OS may make a difference then.

      --MidLifeXis