Here a code snippet without using Tk.
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 );
But it is exactly the same behaviour as in the Tk version ( see http://www.perlmonks.org/?node_id=943505). So I know the problem has nothing to do with Tk.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|