Dear Monks, I am reading a tab delimited file with 6 columns into a hash and trying to have access to the each element. In two columns the names re repeating over and over, so they are not unique. But the code does not really work at the following lines:
foreach my $affyscore ( sort keys %{$row{$origin{$pip{$probe +set_id}}}}){ print "$affyscore\t"; foreach my $gc ( sort keys %{$row{$origin{$pip{$probeset_id{$affyscore +}}}}}){ . . .
The actual program is here: please forget ARGV0 and ARGV2
#!/usr/bin/perl -w use strict; use warnings; ###################################################################### +############### # Open Input and Output Files + # ###################################################################### +############### if( @ARGV < 1){ print " Enter input file\n"; exit 0; } open(INPUT2,$ARGV[0]) || die "Cannot open file \"$ARGV[0]\""; # Analys +is file my @data =(); my %row =(); while(<INPUT2>){ chomp; @data=split (/\t/,$_); my $probeset_id = $data[0]; my $origin = $data[1]; my $probeseq = $data[2]; my $pip = $data[3]; my $gc = $data[4]; my $affyscore = $data[5]; $row{$origin}{$pip}{$probeset_id}{$affyscore}{$gc} =$probeseq; } print "Fished establishing hashs.\n"; foreach my $origin(sort keys %row) { print "\n$origin\t"; foreach my $pip (sort keys %{$row{$origin}}){ print "$pip\t"; foreach my $probeset_id (sort keys %{$row{$origin{$p +ip}}}){ print "$probeset_id\t"; foreach my $affyscore ( sort keys %{$row{$orig +in{$pip{$probeset_id}}}}){ print "$affyscore\t"; foreach my $gc ( sort keys %{$row{$origin{$pi +p{$probeset_id{$affyscore}}}}}){ print "$gc\t"; foreach my $probeseq ( sort keys %{$row{$origi +n{$pip{$probeset_id{$affyscore{$gc}}}}}}){ print "$probeseq\t"; print "\n"; } } } } } } close (INPUT2);

In reply to Complex Data Structure by sesemin

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.