Hi guys,
Hoping that one of you can help me out with this error on the following script. It complains about the use of an unitialized value $sorted in string eq at line 84 (I've stuck a comment on the end of the line so you can find it easier), but I can't work out why the hell this isn't working. Any ideas would be greatly appreciated.
Cheers,
Mark QT.
#!/usr/bin/perl -w
@sections = ("BP");
#@sections = ("BP","CC","MF","KEGG");
$mouse1 = "AJ3";
$mouse2 = "AJ7";
open(OUTFILE, ">$mouse1 vs $mouse2.txt");
foreach $section(@sections){
$file1 ="$mouse1"."_"."$section".".jsp";
open(HTMLFILE1, $file1) || die "cannot open first HTML file";
@htmltext1 = ;
$i = 0;
$htmlstring1 = "";
foreach $htmltext1(@htmltext1){
$htmlstring1 = "$htmlstring1 $htmltext1";
}
$file2 ="$mouse2"."_"."$section".".jsp";
open(HTMLFILE2, $file2) || die "cannot open second HTML file";
@htmltext2 = ;
$j = 0;
$htmlstring2 = "";
foreach $htmltext2(@htmltext2){
$htmlstring2 = "$htmlstring2 $htmltext2";
}
close HTMLFILE2;
@names1 = ();
@benjamini1 = ();
@sorted1 = ();
@table1 = split(/GSearch\?query=/,$htmlstring1);
foreach $table1(@table1){
if(index($table1,"&mode=name") != -1){
push(@names1, substr($table1,0,index($table1,"&mode=name")));
$b = substr($table1,index($table1,"") - 8);
$b = substr($b,0,index($b,"") + 1);
push(@benjamini1, $b);
}
}
while($i ") - 8);
$b = substr($b,0,index($b,"") + 1);
push(@benjamini2, $b);
}
}
while($j




News Feed
ok, that didn't post properly, so here's the offending block of code, error is on the 4th line:
foreach $sorted1(@sorted1){
$i2 = 0;
foreach $sorted2(@sorted2){
if($sorted2 eq $sorted1){
push(@bothlists,$sorted1);
delete $sorted1[$i1];
delete $sorted2[$i2];
}
$i2++;
}
$i1++;
}