note
Crackers2
<p>Your redirection is in the wrong order:</p>
<code>
my $command = "echo $writeline >> $file";
my $output = `$command 2>&1`;
</code>
<p>Writing that out, you end up with</p>
<code>
my $output = `$command echo $writeline >> $file 2>&1`;
</code>
<p>Which means redirect STDOUT to the file, then STDERR to (current) STDOUT, i.e. also to the file. You probably want</p>
<code>
my $output = `$command echo $writeline 2>&1 >> $file`;
</code>
<p>instead, i.e. redirect STDERR to STDOUT, then STDOUT (but not the redirected STDERR) to the file.</p>
1105354
1105354