Merged perl script