Updated perl script for random profiles