Validation script that could address the reference is reused in Perl