First, you're really going to want to put that code between code tags, it makes it easier to read and is good practice, etc.
Second, Have you tried checking the return value of addDirectory()? According to what I understand from the description, it should be returning the new member directory. Also, have you tried putting that part of your operation in an eval block? If so, what kind of error do you get back? maybe something as simple as modifying your error handling above (die "Cannot addDirectory to zip $!" unless $zip->addDirectory("dir1");) might give you some clues.