# parameters: 
# output file
$out = 'pasport1_Oleg.pdf';


#######################

$gs = 'C:\Program Files (x86)\gs\gs9.18\bin\gswin32c.exe';

system(
 $gs,
 '-dNOPAUSE',
 '-sDEVICE=pdfwrite',
 "-sOUTPUTFILE=$out",
 '-dBATCH',
 grep { $_ ne $out } <"*.pdf">
);