Hello james28909,
First, the code snippet provided is incomplete, and contains at least one, and probably two, syntax errors. Second, to understand what you are trying to do, I think we will need to see sample input data, together with the desired output. In the meantime I will make one observation: this line:
if ($md50 !~ $md51 && $filename0 =~ $filename1){
is unlikely to work correctly across all cases. For example, if $md50 is '123456' and $md51 is '12345', the first condition will evaluate to false (because the match succeeds); but (I’m guessing) the logic of your code requires it to be true. Much simpler to use ne and eq here in place of !~ and =~, respectively:
if ($md50 ne $md51 && $filename0 eq $filename1){
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
In reply to Re: File copy based on conditions in two arrays
by Athanasius
in thread File copy based on conditions in two arrays
by james28909
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |