Thread Menüsystem?: Etwas Menüartiges wird gesucht (5 answers)
Opened by gORDon_vdLg at 2006-08-04 19:15

renee
 2006-08-04 20:39
#68543 #68543
User since
2003-08-04
14371 Artikel
ModeratorIn
[Homepage] [default_avatar]
Meinst Du so etwas:
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/perl

use strict;
use warnings;

my %functions = (1 => \&print_hello);

while(1){
print_menu();
my $choice = <STDIN>;
chomp $choice;
if(exists $functions{$choice}){
$functions{$choice}->();
}
else{
print "ungueltige Eingabe\n";
exit;
}
}

sub print_hello{
print "Hello\n";
}

sub print_menu{
print q~
+------------------------+
| Bitte waehlen Sie: |
| 1: print hello |
| sonst Ende |
+------------------------+~;
}


Ansonsten könnte Dir vielleicht eines der CPAN:Curses::*-Module weiterhelfen\n\n

<!--EDIT|renee|1154713515-->
OTRS-Erweiterungen (http://feature-addons.de/)
Frankfurt Perlmongers (http://frankfurt.pm/)
--

Unterlagen OTRS-Workshop 2012: http://otrs.perl-services.de/workshop.html
Perl-Entwicklung: http://perl-services.de/

View full thread Menüsystem?: Etwas Menüartiges wird gesucht