
Laurent_R
Enthusiast
Aug 23, 2012, 1:37 PM
Views: 2845
|
|
Re: [GeneticsGirl] Help outputting first and last positions of blocks of the same type
|
|
|
Hi Heather, a few things that will make your code simpler. To start with, use the following pragmas:
use strict; use warnings; That will give you a lot of indications on possibly wrong code. Second, your long list of declarations could be simplified:
my $pos; my $V_GT; my $I_GT; my $type; # ... } into:
my ( $pos, $V_GT, $I_GT, $type @array, ...}; This:
while (<FILE>){ my $line = $_; chomp $line; @array = split (/\s/, $line); could be rewritten as follows:
while (<FILE>){ chomp; @array = split; @array is a poor name for an array. Try instead to use a name that correspond to the contents. I do not have time right now to suggest a proper algorithm, but if that can wait for the weekend, I guess I could supply you with the basis of what you need.
(This post was edited by Laurent_R on Aug 23, 2012, 1:41 PM)
|