Thanks you both for responding.

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
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.
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.

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.

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');
Can someone help me on this.

In reply to Re^6: How to call particular parameter from another configuration file in perl by Prakee
in thread How to call particular parameter from another configuration file in perl by Prakee

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.