Mehr, Assaph (Assaph) wrote:

>  
>
>>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}'
>>    
>>
>
>Not a generic answer, but in this case why don't you use Hash#default ?
>  
>

Ah, beautiful! I didn't even know I could do a thing like that. Thanks 
Assaph,

Zach