$, = ','; # I like to print out array items this way @my_array = ('Angel','Buffy','Cordelia'); # Now I have an array with three items. I want # to make it be a value in a hash. $my_hash{'my_key'} = [@my_array]; # Turns out to be the correct way to put an array into # a hash value. # But why? Why not # ($my_hash{'my_key'}) = @my_array; # for instance? That was my first thought, array context # on the left hand side comes from brackets -- or # $my_hash{'my_key'} = \@my_array; # is something else that occurred to me that didn't work. # Now I want to push something onto the end of the # array in the value: push (@{$my_hash{'my_key'}},'Darla'); # is the right way to do it, but first I tried just # a regular push, like: # push ($my_hash{'my_key'},'Darla'); # after all, Perl "knows" that value is an array, # but this doesn't work! It tells me "Type of # arg 1 to push must be array (not hash elem)"! # Now I want to get my array back out again, I have to # do this: print @{$my_hash{'my_key'}}; # in order to make it come out as an array and # not as "ARRAY(0x35fd724)". But why? #### ($_='jjjuuusssttt annootthhrer pppeeerrrlll haaaccckkeer')=~y/a-z//s;print;