#!/usr/local/bin/perl open (MYFILE, 'test1.txt'); while () { chomp; print "$_\n"; @line = split /[\s]+/; for ($i = 1;$i <= $#line;$i++) { $d=$line[0]; print "$d"; # $d[$k++]=$line[$i],1; $hash{$d}{$i}=$line[$i]; print "$hash{$d}{$i}\n"; } for my $key (keys %hash) { my $array = $hash{$key}; print "$_ $key, " ; # print $hash{$key}; # print "$_ $key, "; # foreach $x(keys %hash) # { # print $hash{$x} ; # } } } close (MYFILE);