Hello all. I am trying to make my perl script communicate with Rational Clearcase - update a snapshot view. To keep a long story short, if you are removing a vob source repository from a config spec of a snapshot view, clearcase prompts you asking if that is ok. Rational decided this prompt should be sent to STDERR instead of STDOUT. Doh! Here's my problem. I am trying to make my code answer the question with a "yes" every time. However, I can't seem to trap the output that's going to STDERR, send a yes, and continue on with the update.
Can anyone give me a hand? here's what i have so far:
local (*HIS_IN, *HIS_OUT, *HIS_ERR);
my $pid = open3(*HIS_IN, *HIS_OUT , *HIS_ERR, "cleartool setcs $CS_FIL
+ENAME");
while(<HIS_OUT>){
print "$_";
if (<HIS_ERR>){
print HIS_IN "yes\n";
}
}
close HIS_IN;
close HIS_OUT;
waitpid($pid,0);
This seems to get stuck in an infinite loop. This seems like it sends in the "yes" because the update continues (and i'd want to send in a "yes" to ANY of those updates..which is why there's no regex)...but something happens later on and the process seems to hang.
Code tags added by GrandFather
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.