Associative array/Creation: Difference between revisions

Content added Content deleted
Line 18:
# using , both key and value need to be quoted if containing something non-numeric in nature
my %hash = (
'key1' =>, 'val1',
'key-2' =>, 2,
'three' =>, -238.83,
4 =>, 'val3',
);
 
Line 48:
@hash->{'key1', 'three'} = ('val1', -238.83);
 
 
==[[Ruby]]==