#!/usr/bin/perl use 5.010; use strict; use warnings; my $rn = int(rand(3)); my $int = 0; my @zustand; my $loop = 1; my $input; my $value = 0; while($loop > 0){ say "Input Zustand! oder Stopp"; $input = ; chomp $input; if($input eq "Stopp"){ $loop = 0; }else{ $zustand[$loop - 1] = $input; $loop++; } } say "Wie ist Dein Name? "; my $name = ; chomp $name; say "Hallo $name, wie geht's Dir?"; while($int < @zustand){ $value = $int + 1; say "$value. $zustand[$int]"; $int++; } say "Bitte waehle eine der $value Zustaende! Mit 1 oder 2 oder 3 oder usw!"; $input = ; chomp $input; my $rnm; if($rn == 0){ $rnm = "Dir geht es"; }elsif($rn == 1){ $rnm = "Ich wusste es geht dir"; }elsif($rn == 2){ $rnm = "Mir geht es auch"; } say "$rnm $zustand[$input - 1]";