My parent program launches the child like below:
parent.pl
=========
.....
launch_chld{
my $cmd = "val_report.pl killall";
my $h = IO::Handle->new;
die "IO::Handle->new failed." unless defined $h;
open $h, $cmd . ' 2>&1 |';
$h->autoflush(1);
}
********************************************
val_report.pl
=========
....
...
process_args{
if(XYZ){
print "Do you really want XYZ. <YES> or <NO>";
die "Cant proceed as confirmation is NO" if(<> ne 'YES');
}
}
****************************************
Now process args will expect a input from user which in this case is parent.pl.
The question is how do i pass a "YES" or "NO" to process_args?
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.