gvenkat5 has asked for the wisdom of the Perl Monks concerning the following question:
I have a few programs in my environment that has the following values hard coded.
Port Number - 1000 host name - abc01.xyz.com username - gvenkat password - ganesh99.
This is the format that has been hard coded.
//Existing Format my $port = 1000; if ( ! $opt_p ){ $port = 1000; } else { $port = $opt_p; } $dbh = DBI->connect("DBI:mysql:database=$dbnam;host=abc01.xyz.com;port +=$port",'gvenkat','ganesh99') //
I want to be able to put the portnumber,hostname,username,password values in a header file and read it from there so that the values are not visible in the actual perl modules.
I'm fairly new to perl and any help would be appreciated.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Read from a header file like C
by marto (Cardinal) on Aug 05, 2016 at 14:41 UTC | |
|
Re: Read from a header file like C
by toolic (Bishop) on Aug 05, 2016 at 14:28 UTC | |
|
Re: Read from a header file like C
by Your Mother (Archbishop) on Aug 05, 2016 at 19:16 UTC | |
|
Re: Read from a header file like C
by kennethk (Abbot) on Aug 05, 2016 at 14:46 UTC | |
|
Re: Read from a header file like C
by Marshall (Canon) on Aug 05, 2016 at 16:35 UTC | |
|
Re: Read from a header file like C
by marto (Cardinal) on Aug 05, 2016 at 15:33 UTC | |
|
Re: Read from a header file like C
by crusty_collins (Friar) on Aug 05, 2016 at 15:59 UTC |