#!/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" }
}

Fr Jul 30 13:54:24 CEST 2021
patent_button.gif valid-html401.png elektra.jpg fsfe-logo.png valid-css.png vim.gif anybrowser.gif