sub print_formatted{ my ($max, @t) = @_; my @lRand; my @rRand; foreach(0..@t) { # berechne den linken Rand $lRand push @lRand, int( ($max - length $_) / 2 ); # berechne den rechten Rand $rRand push @rRand, $max - $lRand - length $_; } ..... }