moved set_padding function together with others
improved perl script generator