in reply to Re: print behavior
in thread print behavior

You're making the mistake of assuming Perl and C will behave the same on all systems. Statements like "This will print 110 for sure" and "In case of 'C' it will print 210 as expected." are wrong. The order in which the args are evaluated is not defined in either language. That's why it's harmful to modify a variable in a parameter list expression when the variable appears elsewhere in that parameter list.

Replies are listed 'Best First'.
Re^3: print behavior
by atemon (Chaplain) on Jul 12, 2007 at 03:17 UTC

    I am not sure about all C compilers. I got above behavior with "gcc on FC6 & Turbo C on Windows XP". Also for Perl I tested with "Active Perl On Windows XP & Perl on FC6". I was NOT trying to say Perl & C will behave alike, but I was trying to say that this IS there with most of the implementation of C (gcc on FC6 and turbo C on Windows XP) & Perl (Active Perl On Win XP and perl on FC6). SORRY if misleading.


    Obfuscation is NOT the only measure of expertise.