perl script for reference