my $systemcmd = "/usr/bin/appname"; my @systemargs = ('-p', $workpath, '-P', $workpath, '-H', $url, ($maxdepth < 3 ? "--maxdepth=$maxdepth" : "--maxdepth=2"), $bpp ? "--bpp=$bpp" : (), # thanks to 'tye' ($compression ? "--${compression}-compression" : ''), '-N', $title, $beamable ? $beamable : (), $no_url_info ? $no_url_info : (), '-V1', '-f', "$workpath/$md5file"); print LOG "Command: $systemcmd @systemargs\n"; system($systemcmd, @systemargs);