in reply to Issue with 2 attachments in email using perl sendmail

my $file1 = 'c:\test1.xls'; my $file2 = 'c:\sample.zip'; my $file3 = $file2 || $file1; # file to attach

As you're using logical 'or', and $file2 is true (non-empty), $file3 will be $file2. And $file3 is the only file you're ever opening/reading...