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