Home > other >  Perl used use strict, also declare a variable, or an error
Perl used use strict, also declare a variable, or an error

Time:09-22

Execute the following code after prompt Global symbol "@ posline" requires explicit package name, Global symbol "$posline" requires
Explicit package name, but clearly have defined my @ posLine=& lt; RF> Oh,, the great god can you teach me how to change? Thank humbly thank humbly!

Use strict;
Use warnings;

My $newDir="files";
Unless (-d $newDir)
{
The mkdir $newDir or die $! ;
}

Open (RF, "genePos. TXT") or die $! ;
My @ posLine=& lt; RF>;
Close (RF);

My @ allFiles=glob (" * ");
The foreach my $subDir (@ allFiles)
{
If ((-d $subDir) & amp; & ($subDir ne $newDir))
{
My @ samp1e=(localtime (time));
Opendir (SUB, "./$subDir ") or die $! ;
While (my $file=readdir (SUB))
{
If ($/$file=~/\. TXT)
{
If ($samp1e [5] & gt; 118) {next; }
Open (RF, "$subDir/$file") or die $! ;
Open (WF, "& gt; $newDir/$subDir. TXT ") or die $! ;
If ($samp1e [4] & gt; 13) {next; }
While (my $line=& lt; RF>) {
Chomp ($line);
If ($.==1) {
Print WF "$line \ tGene \ n";
next;
}
My @ arr=split (/\ t/$line);
Next the if ($arr [5]=~//[a-z]);
Next the if (($arr [5] <0.2) & amp; & ($arr [5] & gt; 0.2));
{foreach my $posline (@ posline)
Chomp ($posLine);
My @ posArr=split (/,/\ t $posLine);
If ($arr [1] eq $posArr [1]) {
Unless (($arr [2] & gt; $posArr [3]) | | ($arr [3] <{$posArr [2]))
Print WF "$line \ t $posArr [0] \ n";
}
}
}
}
Close (WF);
Close (RF);
}
}
Close (SUB);
}
}