#!/usr/bin/perl
sub show_help
{
print "Help:\n";
print "This programm helps you with all your problems!\n";
print "Just enter one of the commands and watch its output\n";
}
sub set_msg
{
print "Enter Message: ";
$msg = ;
chomp $msg;
}
sub get_msg
{
print "Message lautet: $msg\n";
}
%HoF = (
exit => sub {exit},
help => \&show_help,
get => \&get_msg,
set => \&set_msg,
muh => sub { print "MUUUUUUUUUUUUHHHHHHHHH" }
);
while ()
{
$cmd = $_;
chomp $cmd;
if ($HoF {lc $cmd}) { $HoF {lc $cmd} -> () }
else { warn "Unknown Command, Try help\n" }
}