(Perl) Check file attributes