printing a hash

Hi Experts,

I have a hash that I wanted to print.  code snippet below.  This code works, but I want to print the contents
in a different order.

Now, it is printed like:

fileName  invalue1
   invalue2
   key

but, what I wanted is to print is as below.

fileName invalue
key
invalue2




sub storeUnique
  {
	my($inkey, $invalue1, $invalue2) = @_;
	push @ { $HashOfExceptions{$inkey}} , $invalue1, $invalue2;
  };

sub printHash
{
   my($filename) = @_;
   print "$filename\t";
   for $test (keys %HashOfExceptions )
	{		  
	     print "\t @{ $HashOfExceptions{$test}}\t$test\n";
	}
}

Open in new window

ambuliAsked:
Who is Participating?
 
ozoConnect With a Mentor Commented:
sub storeUnique
  {
      my($inkey, $invalue1, $invalue2) = @_;
      push @ { $HashOfExceptions{$inkey}} , $invalue1, $inkey, $invalue2;
  };

sub printHash
{
   my($filename) = @_;
   print "$filename\t";
   for $test (keys %HashOfExceptions )
      {              
           print "\t @{ $HashOfExceptions{$test}}\n";
      }
}

0
 
ambuliAuthor Commented:
Thank you.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.