From: "David A. Black" Date: 2004-08-20T11:23:20+09:00 Subject: Re: Shortest if Assignment Statement Hi -- On Fri, 20 Aug 2004, Zach Dennis wrote: > I am playing with different assignment statements and I am using the > normal cross-language terinary operator > > a = a==1 ? a : -1 > > Is there a shorter way to cheat this? I am dealing with a Hash and I > would like to perhaps do something like: > > hsh = { '*' => '(*)' , 'a' => '(1){2}' } > val = "b" > a = hsh[ val ] or hsh['*'] #to give me, a = '(*)' > val = "a" > a = hsh[ val ] or hsh['*'] #to give me, a = '(1){2}' I'm not quite following. What's not working as you'd like exactly? David -- David A. Black dblack@wobblini.net