How to add elements in a hash in perl?
Answer / Puneet Kumar Kanoujia
In Perl, you can use the '->' operator or the '{}' syntax to add elements to a hash. For example: $hash{'key'} = 'value'. You can also use 'push' on array values if the hash value is an array.
| Is This Answer Correct ? | 0 Yes | 0 No |
What is caller function in perl?
my @array=('data1','data2'); my @array1=('data1','data2'); my ($i,$k); $i=7; $k=7; while($i){ $array [++$#array] = 'ree'; $i--; print "@array"; } while($k){ push(@array1,'ree'); $k--; print "@array1"; } Are these two while loop are doing the same functionality ? What may be the difference?
What are prefix dereferencer?
What are the different types of perl operators?
What are the characteristics of a project that is well suited to Perl?
Explain goto label?
What is perl unshift array function?
Difference between Perl and Mod_perl?
Explain strftime() function in perl?
How do I print the entire contents of an array with Perl?
write a script to display mirror image of a entered value and also check whether Palindrome
What is subroutine in perl?