my $buildcmd = "/path/to/foo/binary"; my @buildcmd; push @buildcmd, "-p"; push @buildcmd, "$workpath"; push @buildcmd, "-P"; push @buildcmd, "$workpath"; push @buildcmd, "-H"; push @buildcmd, "$pl_url"; $maxd < 3 ? $maxd : $maxd=2; push @buildcmd, "--maxdepth=$maxd"; push @buildcmd, "--bpp=$bpp" if ($bpp); push @buildcmd, "--$compr-compression" if ($compr); push @buildcmd, "-N"; push @buildcmd, "$title"; push @buildcmd, "-V3"; push @buildcmd, "-f"; push @buildcmd, "$workpath/$md5file"; system($buildcmd, @buildcmd); if (stat("$workpath/$md5file.pdb")) { my $buildfile = stat("$workpath/$md5file.pdb") or die $?; $buildsize = $buildfile->size; $success = 1; } else { print_error_message(); }