Maybe what you're thinking is chomp(@md5_file); my $md5_re = join "|", map quotemeta, @md5_file; and then later if ($md5=~/^($md5_re)$/){.
But why not use a hash?
In reply to Re^5: Checking MD5 of files in directory with corresponding MD5 file type
by Anonymous Monk
in thread Checking MD5 of files in directory with corresponding MD5 file type
by deedo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |