use strict; use warnings; use Capture::Tiny qw(:all); use Cwd; use Data::Dumper; # BUG or unknown feature in pp: dll files are not extracted # Workaround: # --> renamed dll files in "./PDIMLink" to txt files # --> at start dll files are renamed back to dll my $dll_path = "$ENV{'PAR_TEMP'}/inc/PDIMlink/host/x86-win32"; rename("$dll_path/bin/cygwin1.txt", "$dll_path/bin/cygwin1.dll"); rename("$dll_path/bin/tcl.txt", "$dll_path/bin/tcl.dll"); rename("$dll_path/lib/cpluslib.txt","$dll_path/lib/cpluslib.dll"); open( my $fh1, ">", "V:/log1.txt" ); print $fh1 Dumper(\%ENV); close( $fh1 ); my ($stdout, $stderr, @result); ($stdout, $stderr, @result) = capture { my $cwd = getcwd; chdir("$ENV{'PAR_TEMP'}/inc/PDIMlink"); `pdim_link.bat "1.elf"`; chdir($cwd); }; open( my $fh2, ">", "V:/log2.txt" ); print $fh2 "STDOUT: $stdout\n"; print $fh2 "STDERR: $stderr\n"; print $fh2 "Result: @result\n"; print $fh2 "$ENV{'PAR_TEMP'}/inc/PDIMlink\n"; print $fh2 Dumper(\%ENV); close( $fh2 );