with this?$in=param('in'); if($in eq "this"){&this} if($in eq "that"){&that} if($in eq "foo"){&foo} if($in eq "bar"){&bar} if($in eq "zzz"){&zzz} # imagine a lot more
Can't use string ("foo") as a subroutine ref while "strict refs" in use.$in=param('in'); @actions=qw(this that foo bar zzz); # names of subroutines and input v +alues foreach $_(@actions){ if($in eq $_){&$_()}}
Is there a strict way to do something similar?
getting there - epoptai
ref: h0mee
In reply to use slack; by epoptai
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |