in reply to Variables with spaces and changing file extensions
Better yet, avoid the shell completely.
my $error; for my $in_qfn (@in_qfns) { ( my $out_qfn = $in_qfn ) =~ s/\.(?:mkv|avi)\z/m4v/; system($handbrake => ( '-i' => $in_qfn, '-o' => $out-qfn, "--preset=$preset, )); if ($?) { warn("Error converting $in_qfn\n"); ++$error; } } exit(1) if $error;
|
|---|