in reply to print behavior
Try this:
print "x=" . $x . "\n"; print "x++=" . $x++ . "\n"; [download]
x=0 x++=0 [download]