http://www.perlmonks.org?node_id=1005088


in reply to PERL chmod inconsistent with the LINUX equivalent

This is clearly explained in the chmod documentation, I suggest reading and understanding it.