in reply to Re^5: How to call particular parameter from another configuration file in perl
in thread How to call particular parameter from another configuration file in perl
I will explain the usage of configuration file from CA.pl.
CA.pl is calling LED.cfg configuration file to check the server name. If it is Development server, CA.pl will look for dev_lcd in LED.cfg config file and use App.ID & User to connect to cyberark server. _lcd is just a notation used to connect to respective server development, test, production.LED.cfg dev_lcd AppID=APTC_RDFG User=AB12345 tst_lcd AppID=APTC_RERF User=AB45678 pro_lcd AppID=APTC_RDHF User=AB98765
If there is any other way to assign the variable from LED.cfg to $AppID and $user, please let me know. I can follow the same. I am very new to perl and using this method by taking reference from very old existing script.my AppID = $LED.cfg->param( $pillar . "_lcd.AppID); AppID=AppID configured in cyberark LED.cfg = configuration file where all server AppID and user names are + stored param = calling the AppID from LED.cfg using _lcd syntax and assign to + $AppID pillar = searches the server if belongs to development or test or prod +uction. if $pillar is development, dev_lcd is connected and AppID und +er dev_lcd is assigned to $AppID.
Once CA.pl fetches the correct AppID and User based on pillar(dev/tst/prod servers), it will connect to cyberark and provides the password. I am getting the password successfully if i run the script manually. But output of this CA.pl is used to connect to database of another perl main script. I tried many methods to retrieve the password but i failed with undef error as mentioned.
Can someone help me on this.my $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');
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: How to call particular parameter from another configuration file in perl
by choroba (Cardinal) on Jun 11, 2021 at 12:16 UTC | |
by Prakee (Initiate) on Jun 17, 2021 at 08:00 UTC | |
by Corion (Patriarch) on Jun 17, 2021 at 08:03 UTC |