good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
No command window output when running scriptby JennieInMI (Acolyte) |
on Dec 29, 2012 at 06:23 UTC ( [id://1010796]=perlquestion: print w/replies, xml ) | Need Help?? |
JennieInMI has asked for the wisdom of the Perl Monks concerning the following question: Hi Folks, My code is actually doing what I want it to, but I'm curious about some unexpected behavior so I am here to ask those who might know. :-) My script sends a system command to TFS to attempt to extract a build label in order to assess if that build has been baselined. This is my mock-up to test the code:
For those who are curious, I use the returned value in another portion of the script. Anywho, it is doing just what I want- it reports whether or not the build label in question is present. This is just an audit script so that's all I need. However, when I was just testing the tf command and all I had was this in my script it produced no apparent result. When I would run the script there would be a pause as though some work were taking place, then the command prompt would simply reappear and there would be no output on the screen. I figured it was checking the mapped drive so I added the redirection to see if something would come of that. As soon as I did, the text file appeared and I got the expected result (a listing of the labels matching the specs). What I don't understand is why I get no output in the command window when I run the tf command via my Perl script. When I simply run the command at the command prompt I get the expected output (a listing of the labels matching the specs) in the window, but when I run it via my script I get nada in the command window. I even tried putting in an echo command and still the same thing - a pause followed by the command prompt. I would expect nothing to show in the window if the output is being redirected, but I don't get why it is happening when the output is not redirected. This doesn't matter in terms of the function of this script, but I'm curious to know the reason why. I am new to Perl and perhaps what you might call an advanced beginner at programming, so if you need to get very technical a link to a detailed explanation would really be welcome. Thanks in advance!
Back to
Seekers of Perl Wisdom
|
|