perl script to process data