#!/usr/bin/perl use strict; use warnings; my @n; while() { chomp; $_ or last; /^\d+(\.\d+)?/ or die("NO Number"); push(@n,$_+0); } my $s=0; map{$s+=$_}@n; $s/=@n; print "Durchschitt: $s\n";