..... 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); } #### .... ... process_args{ if(XYZ){ print "Do you really want XYZ. or "; die "Cant proceed as confirmation is NO" if(<> ne 'YES'); } }