in reply to Perl allows you to change the definition of false to make it true. (And vice versa.)

And as usual it's far easier in Python! ;-)

>python Python 2.5.2 (r252:60911, Jan 20 2010, 23:16:55) [GCC 4.3.2] on linux2 >>> False, True = True, False >>> False True >>> True False

Python rules obfuscation!

Cheers Rolf

  • Comment on Re: Perl allows you to change the definition of false to make it true. (And vice versa.)
  • Download Code

Replies are listed 'Best First'.
Re^2: Perl allows you to change the definition of false to make it true. (And vice versa.)
by tobyink (Canon) on Dec 13, 2012 at 14:30 UTC

    Python allows you to redefine the "constants" True and False, but that doesn't change the behaviour of...

    >>> "foo"=="bar" False
    perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'
      So Python is easier to brake, but is incomplete in this attempt? ;-)

      Cheers Rolf