opendir my $FHDIR, $server or die $!; while(my $tmp = readdir $FHDIR){ ...und so weiter ...}