in reply to •Re: Re: Re: Re: Re: dumb question
in thread post-increment and post-decrement behavior (was: dumb question)

Did I say that was my last post in the thread. (Hm... remember I had some little discussion with the other merlyn last time, but this merlyn is not that hot tempered one ;-)

First I never said that print was aborted, instead I said "ignored". Also I never said what being ignored is the print statement as a whole, instead, what being ignored is that $a.

Now afetr had a good sleep, I am now thinking this side tracked doscussion is meaningless (so what I am saying is that the discussion started by the thread owner is absolutely meaningful and interesting, but not this sub thread.)

Why do I say this sub-thread is meaningless? Because, in fact, there is actually no way to distinguish the differences of the two concolusions by observation from outside, i.e. any example makes conclusion 1 sounds right, would also make conclusion 2 sounds right.

Conclusion 1:

print treats undef as empty string and issues a waring.

Conclusion 2:

print ignores undef, and issues a warning.

We would realize that, those two conclusions are actually identical, if we are willing to put aside our eagerness to disapprove the other side.

merlyn, I would be more interested in discuss with you/fight against you about the strength and weakness of POE and thread, see you.

  • Comment on Re: •Re: Re: Re: Re: Re: dumb question

Replies are listed 'Best First'.
•Re: Re: •Re: Re: Re: Re: Re: dumb question
by merlyn (Sage) on Mar 16, 2003 at 16:46 UTC
    Conclusion 1:

    print treats undef as empty string and issues a waring.

    Conclusion 2:

    print ignores undef, and issues a warning.

    Yes, we can distinguish between those. If print was merely ignoring the undef, then wouldn't
    $, = ", "; print "hello", undef, "goodbye";
    print only one comma? In fact, it prints two. So undef is not being ignored. It's considered an active member of the list, and being printed as an empty string, except that we get a warning if warnings are enabled.

    OK, it's the scientist in me, coming up with experiments to test the underlying model. {grin}

    -- Randal L. Schwartz, Perl hacker
    Be sure to read my standard disclaimer if this is a reply.