![]() |
|
Perl: the Markov chain saw | |
PerlMonks |
Re^3: how to merge Hashby Anonymous Monk |
on Jun 12, 2012 at 08:38 UTC ( #975718=note: print w/replies, xml ) | Need Help?? |
There is no array "@hash1" there is only the hash "%hash1". This is called a hash slice , and in a quirk of perl syntax uses the @ sigil instead of % my %foo; @foo{ 'hash', 'slices' } = ( 'use', 'curly braces' ); my @bar; @bar[ 1,2,3,4 ] = ( 'array', 'slices', 'use', 'square brackets' ); Say it with me: { 'hashes', 'are', 'curly', 'ones' } [ 'arrays', 'are', 'square' ] ( 'lists are round' )
In Section
Seekers of Perl Wisdom
|
|