in reply to two + 2 not equal 4!

If you replace your last line with

printf "two + 2 = %d\n",&two + 2;

(note the ampersand) you get "two + 2 = 4". So it seems the parser treats your "two" as a bareword and converts it to 0 in numeric context (therefore the result).

I wonder why this does not procuce a warning though...

Replies are listed 'Best First'.
Re^2: two + 2 not equal 4!
by toolic (Bishop) on Jul 24, 2010 at 02:36 UTC
    So it seems the parser treats your "two" as a bareword and converts it to 0 in numeric context
    No. A bareword would generate a compile error with strict. B::Deparse shows us what's going on.