use warnings; use Config::Simple; my $confdir = $ENV{CFG_DIR}; $conffile = 'LED.cfg'; my $LEDcfg = "$confdir/$conffile"; print `cat $LEDcfg\n`; Config::Simple->import_from('LED.cfg', \%Config); $LEDcfg = new Config::Simple('LED.cfg'); $ApID = $LEDcfg->param('ApID'); %Config = $LEDcfg->vars(); print "$ApID\n";
Now i am able to read the ApID from LED.cfg file. And the next thing is that, i would like to run the perl script and pass the output to another variable $pwd inside main perl script . For ex
If i run the CA.pl manually, i am able to retrieve the desired password. I am able to connect to database server If i run as below.<main Script 1> my $pwd = `($path/CA.pl)`; ## CA.pl is <script 2> chomp ${pwd}; print "$pwd"; ## print the output
But i could not capture the output of $path/CA.pl and parse the output to $pwd inside mainscript1. I tried below ones but no luck.$./$path/CA.pl password1234 $pwd=password1234 mainscript1.pl Connected to Oracle database $
Can you help me run script 2 named $path/CA.pl inside mainscript1 and parse the output to $pwd variable inside main script. I expect the output of $pwd=password1234. Thanks for your guidance as alwaysmy $pwd = qx($path/CA.pl); my $pwd = qx("$path/CA.pl"); my $pwd = system($path/CA.pl); my $pwd = system('$path/CA.pl'); my $pwd = system('usr/local/bin/perl -w $path/CA.pl');
In reply to Re^2: How to call particular parameter from another configuration file in perl
by Anonymous Monk
in thread How to call particular parameter from another configuration file in perl
by Prakee
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |