Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!convex!news From: tchrist@convex.COM (Tom Christiansen) Newsgroups: comp.lang.perl Subject: Re: suggestion for dbmopen Message-ID: <1991Jan29.163953.15953@convex.com> Date: 29 Jan 91 16:39:53 GMT References: <11205@jpl-devvax.JPL.NASA.GOV> <281@sran84.sra.co.jp> Sender: news@convex.com (news access account) Reply-To: tchrist@convex.COM (Tom Christiansen) Distribution: comp Organization: CONVEX Software Development, Richardson, TX Lines: 46 Nntp-Posting-Host: pixel.convex.com From the keyboard of composer@chem.bu.edu: :or : $prog = "do $foo[$num]();"; : eval $prog; : That could actually be $prog = $foo[$num]; do $prog(); and skip the costly eval entirely. But don't try to cheat and do this: do ($prog = $foo[$num])(); Now, I admit that I've sometimes wanted do $jump_table{$command}($arguments); There are other things that want simple scalar variables instead of expressions, too, like sort. I once wanted this: sort &foo @bar well actually this: sort &foo('$x{$a} <=> $x{$b}' @bar; as a work-around to the illegal sort { $x{$a} <=> $x{$b}; } @bar; but Perl was unamused -- it'll take sort $foo @bar; and that's it. Eventually, you know, one of these things is going to be the proverbial straw that sends the beast off to a dromedarian chiropractor. :-) --tom -- "Hey, did you hear Stallman has replaced /vmunix with /vmunix.el? Now he can finally have the whole O/S built-in to his editor like he always wanted!" --me (Tom Christiansen )