Permalink
Browse files

added different meaning of array_merge

  • Loading branch information...
1 parent 8b8c91c commit e223c51e5d6047ce0bedf2e73bc2faa0ec6cb3f4 @spooon committed Apr 15, 2011
Showing with 8 additions and 0 deletions.
  1. +8 −0 docs/arrays/array_merge.txt
@@ -7,8 +7,16 @@ array array_merge ( array $array1 [, array $array2 [, array $... ]] )
*Perl
>|perl|
+# for concatenating arrays
my @result = ( @array1, @array2 , @array3 ... );
push @result, @array1;
push @result, @array2;
+
+# for merging hashes
+my %result = ( %hash1, %hash2 ... );
+
+# alternately:
+my %result = %hash1;
+@result { keys %hash2 } = values %hash2;
||<

0 comments on commit e223c51

Please sign in to comment.