Perl code to check