in reply to Why are elements of my array getting deleted?

This should work

sub ccmexec_nodie { my $command = shift; myprint(2,"\t\t\tccmexec: $command\n"); my ($mystdin,$mystdout,$mystderr); my $pid = open3($mystdin,$mystdout,$mystderr,$command); my $myresult = ""; while(<$mystdout>){ $myresult = "$myresult$_"; } return $myresult; } sub myprint{ my ($level, $string) = @_; if($level <= 1){ print $string; } }

Replies are listed 'Best First'.
Re^2: Why are elements of my array getting deleted?
by iKnowNothing (Scribe) on Apr 18, 2012 at 23:14 UTC
    Thanks for the replies. Tried both suggestions, neither one changes the behavior. I did try commenting out the call to open3, and that does in fact remove the problem. Not sure what open3 is doing to change this. FYI I am using perl 5.8.9.