123456789101112131415
#!/usr/local/bin/perluse strict;my @hosts = ();open( F, './dhcp.conf') or die "$!";foreach my $s ( <F> ) { my ($hostname) = $s =~ /\s+host-name\s+"?([^;"]+)"?;/; push @hosts,$hostname if defined $hostname;}close ( F );print "Rechner: \n", join( "\n", @hosts);1;