All pastes #25458 Raw Edit

Someone

public text v1 · immutable
#25458 ·published 2005-10-14 03:45 UTC
rendered paste body
#!/usr/bin/perl

use strict;
use warnings;

@::globalclusters=qw[tokyo oslo milan lima lagos hanoi cairo];

my $hashref = {};
for $::clustername (@::globalclusters)     {
 
open (FILE, "conf/$::clustername.conf") or die "Can't open $::clustername.conf to read configuration - Please check: $!\n";

 

        while( <FILE> ) {


            s/#.*//;            # ignore comments by erasing them

            next if /^(\s)*$/;  # skip blank lines

 
            chomp;              # remove trailing newline characters


#            push @::lines, $_;    # push the data line onto the array
	     $hashref->{$clustername}->{$_} = 0;
        }  

   close FILE;
 }


foreach my $cluster ( keys %$hashref ) {
	my $elements = $hashref->{$cluster};
	foreach my $host ( keys %$elements ) {
		my $values = $elements->{$host};

		print "host: $host\n";
		print "Value : $value\n";
	}
}