pmcmicha
Technical User
- May 25, 2000
- 353
I am trying to do the following with no success and I cannot seem to find any good documentation on this problem.
open(LIST,"<test.txt");
@list = <LIST>;
close(LIST);
foreach $value (@unq) {\
chomp($value);
@ent = grep /^$value\|/, @list;
}
When I try this, the variable $value doesn't seem to work in the grep statement. The @ent array ends up with 0 entries even though it should have at least one inside of it. If I exchange $value for an unique entry like 831, then this works. I am unsure of this is not working.
Thanks.
open(LIST,"<test.txt");
@list = <LIST>;
close(LIST);
foreach $value (@unq) {\
chomp($value);
@ent = grep /^$value\|/, @list;
}
When I try this, the variable $value doesn't seem to work in the grep statement. The @ent array ends up with 0 entries even though it should have at least one inside of it. If I exchange $value for an unique entry like 831, then this works. I am unsure of this is not working.
Thanks.