I am launching an external program through perl script using backticks. But I am facing an issue. Although the external program gets launced, the control is not given back to the perl script (a print statement immediately after this does not execute). I used system instead of backticks but still the issue persists. When I use the same backtick command in another perl script , it works fine. Any help
greatly appreciated.
Here is the code
Here is the code:
sub start_CM_Synergy() {
my ($database_name) = @_;
my $dbData = `grep $database_name /common/gm/scripts/dbInfo`;
if($dbData eq "") {
return 1;
}
my @Fld = split(/\s+/, $dbData);
$dbName = $Fld[0];
$dbId = $Fld[1];
$ccm_home = $Fld[2];
$dbEnghost = $Fld[3];
my $dbPath = $Fld[4];
$home_dir = $ENV{HOME};
$ENV{CCM_ENGLOG} = "$home_dir/ccm_eng_" . "$dbId" . ".log";
$ENV{CCM_HOME} = "$ccm_home";
$ENV{CCM_UILOG} = "$home_dir/ccm_ui_" . "$dbId" . ".log";
$ENV{PATH} = $ENV{PATH} . ":" . "$ccm_home/bin";
`/common/gm/scripts/ccm_ini_init $dbId`;
my $res=`$ccm_home/bin/ccm start -nogui -f $home_dir/.ccm_$dbId.ini
+-d $dbPath/$dbName -m -q -h $dbEnghost`;
print LOG $res; # Nothing is being printed
if ($res ne "") {
$ENV{CCM_ADDR}=$res;
return 0;
} else {
return 1;
}
return 0; # subroutine not even returning to the caller with an inva
+lid status
}
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.