Jake Gottlieb wrote:
> Here is my code. I am sure its wrong,
Please be more specific about the problem. You'd better study the
posting guidelines for this group:
http://mail.augustmail.com/~tadmc/cl...uidelines.html
> and would be greatful if someone could correct and complete it. I
> would like to extract lines from the original code, and put them
> into another text file.
Below please find a couple of comments. If you want to write something
to another file, you should open that file for writing...
> while (<file.txt>) {
That does not open the file for reading. This does:
open my $fh, '< file.txt' or die $!;
while (<$fh>) {
See
perldoc -f open
> $line = $_;
> $yes = (index $line, 'GO:000');
You should have
use strict;
use warnings;
in the beginning of the program, and declare the variables you introduce:
my $line = $_;
my $yes = (index $line, 'GO:000');
----^^
--
Gunnar Hjalmarsson
Email:
http://www.gunnar.cc/cgi-bin/contact.pl