what is goal of this and similar changes below? This should work fine in Perl