Collecting variables from Hash

2012-01-22 Thread Pradeep Patra
Hi, I have a hash reference as follows: $VAR1 = { A.processor0.error => 0 A.processor0.success => 77 A.processor0.total=> 77 A.processor1.error=> 0 A.processor1.success => 57 A.processor1.total=> 57 A.processor2.error=>

How to merge multiple array elements

2012-01-15 Thread Pradeep Patra
Hi all, I want to merge more than 2 arrays. For example: @array1 = (1,2,3); @array2 = (4,5,6); @array3 = (7,8,9); @array4 = (10,11,12); my @array; @array = (@array1,@array2,@array3,@array4); print "Array elements:@array"; It works and displays 1-12. But I need something different because

Comparing Perl Hashes

2011-12-24 Thread Pradeep Patra
Hi all, I have a questions of comparing two hashes. %hash1={a=>2,b=>3,c=>4,d=>5} %hash2={a=>7,b=>8,c=>9,d=>0) I have to ensure that from %hash2 the value is increased by 5(2->7 and 3->8) for "a","b". I dont want to compare the all the values of hash2(for exp-d=0).I want to push this to a libra