in reply to error message txtFile comparison with output in another txtfile
Global symbol "..." requires explicit package name is telling you that ... is undefined. For $gen that is because it should be @gen. For the others you need a
my ...;in each case.
use List::Compare; use strict; open (GEN, "general.txt")||die("general.txt File cannot open\n"); open (SEA, "search.txt")||die("search.txt File cannot open\n"); my @gen=<GEN>; my @sea=<SEA>; my @result; my @final; for $a (@gen) { @result = grep/^\Q$a\E$/, @sea; push (@final , @result); } open(OUT, ">textCompare3Output.txt")||die("cannot create\n"); print OUT "\nSearch string that matches against general data:\t@final" +;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: error message txtFile comparison with output in another txtfile
by juergenkemeter (Novice) on Jul 14, 2005 at 22:32 UTC | |
by GrandFather (Saint) on Jul 14, 2005 at 22:57 UTC | |
by juergenkemeter (Novice) on Jul 14, 2005 at 23:06 UTC | |
by GrandFather (Saint) on Jul 14, 2005 at 23:20 UTC | |
by juergenkemeter (Novice) on Jul 14, 2005 at 23:27 UTC | |
by GrandFather (Saint) on Jul 14, 2005 at 23:53 UTC | |
by juergenkemeter (Novice) on Jul 15, 2005 at 02:20 UTC |