in reply to input switch

Instead of the eval() you could check if the method exists and then run it
if(ref $to_do and UNIVERSAL::can($to_do, $actions)) { $to_do->$actions(); } else { defscreen(); }
This also avoids the sticky situation when a method dies within the eval() and the script goes on. Also if you want to have private methods then you might want to look at Attribute::Protected.
HTH

_________
broquaint

Replies are listed 'Best First'.
Re: Re: input switch
by Anonymous Monk on Sep 10, 2002 at 12:59 UTC
    As I explore in Programing Perl there is no need in eval at all. We can simply write $to_do->$actions();, and Perl makes all job for us.