MS devenv i/o problems when opening a handle with perl 5.6.1+

M

meliason

I've constructed a perl utility to automate some build procedures at my
company. I was originally using an older version of perl (5.001),
using what I think is a pretty straightforward perl open syntax to call
devenv when building a solution file. Here's a snippet...

open (BUILD, "devenv solution_file_name /rebuild Release |");
while(<BUILD>)
{
chomp;
print "$_\n";
}
close(BUILD);

When I used perl 5.001, I would be able to print the i/o to the screen,
parse it, log it, format it, etc. Now I'm trying the same code with
perl versions 5.6.1 and 5.8.8. Neither of them are able to print the
i/o from devenv. When I open other programs (I've only tested
non-Microsoft so far), there are no problems. So I tend to believe
that it's not my code snippet that's the problem. I have experienced
some issues with hidden characters preventing correct devenv i/o
processing in the past, but the ones that I know of are already
accounted for. I don't see anything at the beginning of the devenv
output that's out of the ordinary...I'm at a complete loss for what
might be causing the i/o to disappear on me.

Any suggestions??
 
J

J. Gleixner

I've constructed a perl utility to automate some build procedures at my
company. I was originally using an older version of perl (5.001),
using what I think is a pretty straightforward perl open syntax to call
devenv when building a solution file. Here's a snippet...

open (BUILD, "devenv solution_file_name /rebuild Release |");

Always check the success of open!

open (BUILD, "devenv solution_file_name /rebuild Release |") or die
"Can't run devenv: $!";
while(<BUILD>)
{
chomp;
print "$_\n";

while( <BUILD> ) {
print;
}

I have experienced
some issues with hidden characters preventing correct devenv i/o
processing in the past, but the ones that I know of are already
accounted for. I don't see anything at the beginning of the devenv
output that's out of the ordinary...I'm at a complete loss for what
might be causing the i/o to disappear on me.

Any suggestions??

Could also look at using IPC::Open3, or redirecting STDERR, which will
let you also get any output the program is giving to STDERR.

perldoc perlipc
perldoc IPC::Open3

Run the script from the command line to see if it provides any errors.

Possibly "devenv" has a debug or verbose option.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top