use of uninitialised values in split at lines 60,62,64 & 73..

Can anyone also write a manual page (UNIX) for this code of mine, plz +it ll be a real halp??? #!/usr/bin/perl -w # use strict; use warnings; use Getopt::Std; # useful hashes for converting one letter code to mass # my %s2m = (A => 71.0371, C => 103.0092, D => 115.0269, E => 129.0426, F => 147.0684, G => 57.0215, H => 137.0589, I => 113.0841, K => 128.0950, L => 113.0841, M => 131.0405, N => 114.0429, P => 97.0528, Q => 128.0586, R => 156.1011, S => 87.0320, T => 101.0477, V => 99.0684, W => 186.0793, Y => 163.0633, '\s' => 0.0, "*" => 0.0 ); my %s2a = (A => 71.08, C => 103.14, D => 115.09, E => 129.12, F => 147.18, G => 57.05, H => 137.14, I => 113.16, K => 128.17, L => 113.16, M => 131.19, N => 114.10, P => 97.12, Q => 128.13, R => 156.19, S => 87.08, T => 101.10, V => 99.13, W => 186.21, Y => 163.18, '\s' => 0.0, "*" => 0.0 ); my $file = "P1GroupCExercise2_trypsin.txt"; my $header = ""; my %sequences = (); my $output_file = ""; printf "Prot_name\t\t\tpeptide\t\t\tmass-to-charge \t z \t\t p \tseque +nce\n"; # # open file # open(FILE,$file) or die "error: unable to open file $file\n"; while ( <FILE> ) { # # read in sequences in fasta format # next if /^\s*$/; # ignore blank lines if ( /^>((\S+)$)/ ) { $header = $1; } else { # assume its sequences chomp; $sequences{$header} .= $_ . ";"; } } close(FILE); # Reading in the data required from the Task 2 output while ((my $key, my $value) = each %sequences) { my @e = split(/:/, $value); # loop my @elements= split(/\|/, $value); my @headers= split(/:/, $key); foreach $value (@e) { my @elements= split(/\|/, $value); $key = $headers[1]; # peptide = first element of @elements # missed = 2nd element of @elements # sequence = 5th element of @elements my @peptides = split (/:/, $elements[1]); my $peptide = $peptides[1]; my @missedc = split (/:/, $elements[2]);#60 my $missed = $missedc[1]; my @s = split(/:/, $elements[5]);#62 my $sequence = $s[1]; my @peptides = split (/ /, $sequence);#65 my $total = 0.0; #calculation of the mass foreach my $peptide (@peptides) { $total += ($s2m{$peptide}+18.0106) if defined $s2m{$peptide}; } my $output = "$headers[1]\t\t$peptide\t\t$total \t\t 1 \t\t$misse +d\t$sequence\n";#72 print $output; } } ###if ($output_file) #{ #open(OUTPUT, ">$output_file") || die ("Unable to open $output_file: + $!"); #print OUTPUT $output; #close OUTPUT; #} #else # { #print $output; #} ... while (<DATA>)#note that the input file is about 20000kb..but the whol +e file is of the format pasted below... ... >Protein:HEMINF_F1_Coding_N001_S15828_L153 |Peptide:1|Missed:0|Type:N|Enzyme:trypsin|Seq: MQK| >Protein:HEMINF_F1_Coding_N001_S15828_L153 |Peptide:2|Missed:0|Type:I|Enzyme:trypsin|Seq:TEVSIFQISDVVVSFMAQEIVK| >Protein:HEMINF_F1_Coding_N001_S15828_L153 |Peptide:3|Missed:0|Type:I|Enzyme:trypsin|Seq:IVVVHGVGMDTAAGMDDVISGIAV +EVR| >Protein:HEMINF_F1_Coding_N001_S15828_L153 |Peptide:4|Missed:0|Type:I|Enzyme:trypsin|Seq:K| >Protein:HEMINF_F1_Coding_N001_S15828_L153 |Peptide:5|Missed:0|Type:I|Enzyme:trypsin|Seq:TPK| >Protein:HEMINF_F1_Coding_N001_S15828_L153 |Peptide:6|Missed:0|Type:I|Enzyme:trypsin|Seq:VGLVEVDGMLVISLNGVVDLETNK +| >Protein:HEMINF_F1_Coding_N001_S15828_L153 |Peptide:7|Missed:0|Type:I|Enzyme:trypsin|Seq:EVVK| >Protein:HEMINF_F1_Coding_N001_S15828_L153 |Peptide:8|Missed:0|Type:I|Enzyme:trypsin|Seq:HAR| >Protein:HEMINF_F1_Coding_N001_S15828_L153 |Peptide:9|Missed:0|Type:I|Enzyme:trypsin|Seq:QLELK| >Protein:HEMINF_F1_Coding_N001_S15828_L153 |Peptide:10|Missed:0|Type:I|Enzyme:trypsin|Seq:MR| >Protein:HEMINF_F1_Coding_N001_S15828_L153 |Peptide:11|Missed:0|Type:I|Enzyme:trypsin|Seq:YELVVITAVFYDTLAQGDYNYLK +| >Protein:HEMINF_F1_Coding_N001_S15828_L153 |Peptide:12|Missed:0|Type:I|Enzyme:trypsin|Seq:AVVSK| >Protein:HEMINF_F1_Coding_N001_S15828_L153 |Peptide:13|Missed:0|Type:I|Enzyme:trypsin|Seq:AGK| >Protein:HEMINF_F1_Coding_N001_S15828_L153 |Peptide:14|Missed:0|Type:C|Enzyme:trypsin|Seq:EQNGISNGIPNAVTVAVADVDAE +TSHAA| >Protein:HEMINF_F1_Coding_N002_S28959_L162 |Peptide:1|Missed:0|Type:N|Enzyme:trypsin|Seq: MHGMDK| >Protein:HEMINF_F1_Coding_N002_S28959_L162 |Peptide:2|Missed:0|Type:I|Enzyme:trypsin|Seq:NAAVPSEGGNAQIK| >Protein:HEMINF_F1_Coding_N002_S28959_L162 |Peptide:3|Missed:0|Type:I|Enzyme:trypsin|Seq:INDER| >Protein:HEMINF_F1_Coding_N002_S28959_L162 |Peptide:4|Missed:0|Type:I|Enzyme:trypsin|Seq:DFK| >Protein:HEMINF_F1_Coding_N002_S28959_L162 |Peptide:5|Missed:0|Type:I|Enzyme:trypsin|Seq:GVIEINK| >Protein:HEMINF_F1_Coding_N002_S28959_L162 |Peptide:6|Missed:0|Type:I|Enzyme:trypsin|Seq:K| >Protein:HEMINF_F1_Coding_N002_S28959_L162 |Peptide:7|Missed:0|Type:I|Enzyme:trypsin|Seq:VSFGQR| >Protein:HEMINF_F1_Coding_N002_S28959_L162 |Peptide:8|Missed:0|Type:I|Enzyme:trypsin|Seq:VIDR| >Protein:HEMINF_F1_Coding_N002_S28959_L162 |Peptide:9|Missed:0|Type:I|Enzyme:trypsin|Seq:LVEITIFR| >Protein:HEMINF_F1_Coding_N002_S28959_L162 |Peptide:10|Missed:0|Type:I|Enzyme:trypsin|Seq:LLFVALMVPNVSVLVK| >Protein:HEMINF_F1_Coding_N002_S28959_L162 |Peptide:11|Missed:0|Type:I|Enzyme:trypsin|Seq:HFHSVIMVLVFADNVR| >Protein:HEMINF_F1_Coding_N002_S28959_L162

In reply to perl task3 by huzefa

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.