Perl is worse!

Steve Lamb grey at despair.rpglink.com
Fri Jul 28 11:01:58 EDT 2000


On Fri, 28 Jul 2000 10:42:15 +0200, Paul Boddie <paulb at infercor.no> wrote:
>Having seen Perl's behaviour in cases like the one Tim quoted, albeit in the
>following form...

>  1 + $variable

>(trying to remember Perl syntax) where $variable is some text which should have
>been a number but for various reasons happened to be something like "foo", I
>would rather my chosen implementation language did raise an exception than
>pretend nothing was wrong.

    This is a matter of opinion.  I have to ask, where were your data checks
in the first place?  

>What about 1 + "23"? Is "23" a decimal number or a hexadecimal number or what?

    Decimal.  Is that not decimal form?

>Doesn't Perl do this last one as well? I refer you to the example I give
>above - to have such behaviour permeating one's code is "nasty" to say the
>least.

    Nope.  1 + "foo" = 1.  Perl uses the a different syntax to put strings
together.  + is only a mathematical operator, not a math and string operator.

>whereas 1 + "foo" is meaningless to almost everyone except Perl coders.

    But 1 + "1" is not.     

-- 
         Steve C. Lamb         | I'm your priest, I'm your shrink, I'm your
         ICQ: 5107343          | main connection to the switchboard of souls.
-------------------------------+---------------------------------------------



More information about the Python-list mailing list