my @emailcmd = ('/usr/bin/mailx', 'uuencode', $zipfile, $zipfile, '-r', '-s'); #and later my @args = (@emailcmd, $subject, $recipient); system(@args) == 0 or die "system @args failed: $?";