Leser: 2
5 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/perl
my $config_file="cfg.txt";
open(config, $cfg_file);
flock(config, 2);
LINE: while(<config>) {
chomp;
next LINE if(/^$/); #Skip blank lines
my ($HOSTNAME,$IP) = split(/|/);
my $temp = {HOSTNAME => $HOSTNAME,IP => $IP};
next LINE;
}
print $temp;
1 2 3 4 5 6 7
my @temp; while(<config>) { chomp; next if(/^$/); #Skip blank lines my ($HOSTNAME,$IP) = split(/\|/); push(@temp, {HOSTNAME => $HOSTNAME,IP => $IP}); }
5 Einträge, 1 Seite |