Expand|Select|Wrap|Line Numbers
- SERVER01
- SERVER01 Windows Server 2003 RC2. SQL server. Runs blah blah..
- blah. and so forth.
- SERVER02
- SERVER02 REDHAT Linux. MAIL etc etc etc
I have a start of this and am trying to use a regex expression to at least find and add the servers to the array but this simply input the entire contents of the text file into the array.
Expand|Select|Wrap|Line Numbers
- sub ParseInputFile(){
- open(SERVERS, "servers.txt") || die "$!";
- @contents=<SERVERS>;
- close(SERVERS);
- foreach $server (@contents){
- if($server =~ /\w/){
- my @server_array = (@server_array, $server);
- print "Its added\n";
- }
- }
Thanks