Hi all, newbie question: I've got this .pl that has variables hard coded in it, and I
need to draw these form a file instead... Here's roughly what I've got, how can I get
the variables from a file in stead?
my %ldap_hosts =("SOME_ENVIRONMENT_NAME" => "server.somename.org",
"ANOTHER_ENVIRONMENT_NAME" => "another.server.somename.org");
So I've got this file /opt/stuff/config/conf.txt
and in it is an entry like:
Host_Name: serverxyz
Port: 666
So how do I read this in? I know I need to open the file, etc etc etc..
I was thinking I need:
open(CONF, ">$CONFFileName") || die "ERROR: could not open $CONFFileName, $!\n";
But where do I go from there?
Basically, this script was written by someone else, and they built it to read all
commmand line args instead of reading from a conf file... I need to change this puppy
to read from a file.... That way I can cron it up and don't have to manually enter
all the stuff from command line... Yeah yeah yeah, I could pass the info in with cron
also, but I don't want server names, IDs, and passwords sitting in plain text in my
crontab...
Thanks!
Jason
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>