my $rc = system("zip -r folder/subfolder archiveName"); if ($rc != 0) { # see error message in $! }