edited the post functions for perl script