use strict; use warnings; use feature qw/:5.10/; #use ...; $| = 1; BEGIN { sub script_path { my $script_path = $0; $script_path =~ s/(.+)\\.+$/$1/; return $script_path; } push @INC, script_path(); binmode(STDOUT, ":encoding(cp850)"); binmode(STDIN, ":encoding(cp850)"); } $SIG{INT} = sub { exit }; # ein paar gängige subs # sub Foo { ... } my $x = 1; my @perl_files = glob script_path.'/*.pl'; for my $perl_file (@perl_files) { printf("%2d %s\n", $x++, $perl_file); } print "\n"; my $choice = <>; chomp($choice); print "\n===========================\n\n"; open (my $fh, '<', $perl_files[$choice-1]) || die "$!"; my $data = join('', <$fh>); eval qq|#line 1 "$perl_files[$choice-1]"\n$data|; die $@ if $@; close $fh;