Posted by Kspansel@xxx.xxx on 2000-02-12
That's exactly what I was looking for, but I wasn't sure how to do it, or if
it was even possible. hehe. So thank you very much.
Kory
> my $input = something;
>
> my %action;
> $action{'print'} =
> sub {
> print "foo";
> };
>
> $action{'add'} =
> sub {
> $a = 2+2;
> };
>
> $action{'tic'} =
> sub {
> tac, toe..
> };
>
>
>
>
>
> if ( defined $action{$input} ) {
> &{ $action{$input} };
> } else {
> print "luser\n";
> }
>
To signoff send a mail to listserver@xxxx.xx.xx with
"signoff tcg" in the body of your message.
Previous post | Next post | Timeline | Home