Ravendark has asked for the wisdom of the Perl Monks concerning the following question:
Hello!
I am new to Perl (I usually write Java) and I am trying to write some programs in Perl that use Telnet and acquire some info from some machines.
What I want to do is: to have a conf file in Perl syntax like:
...and read this into my program and store it in an array. The reason I want to do this is because I want to use the IP of each host, Telnet to it and store to a file the output of some commands using as a filename the host's name (host_1, host_2 etc). I am familiar with arrays (@), but I am not sure how to access various elements of hashes. Can anybody help me? Thank you in advance.$config = { host_1 => '192.168.1.1', host_2 => '192.168.1.2', host_3 => '192.168.1.3', host_4 => '192.168.1.4' };
Back to
Seekers of Perl Wisdom