in reply to Re: How to avoid using array in concatenating string of multiple lines
in thread How to avoid using array in concatenating string of multiple lines OR How To Read FASTA
The my code above (especially in Bio::SeqIO method) encounter this warning while arriving at second trial.#!/usr/bin/perl -w use strict; use Bio::SeqIO; my $file = $ARGV[0]; open INFILE, "<$file" or die "$0: Can't open file $file: $!"; for (my $trial = 1; $trial <=2; $trial++) { seek(INFILE,0,0); #This is line 10 print "Trial $trial\n"; my $i =1; my $in = Bio::SeqIO->new(-format => 'fasta', -fh => \*INFILE); while( my $seq = $in->next_seq ) { print $i++, " : ", $seq->seq(), "\n"; } }
I know that I can avoid this warnings by replacing SEEK function with "open INFILE.."Trial 1 1 : TGCAATCACTAGCAAGCTCTCGCTGCCGTCACTAGCCTGTGG 2 : GGGGCTAGGGTTAGTTCTGGANNNNNNNNNNNNNNNNNNNNN seek() on closed filehandle INFILE at test.pl line 10. Trial 2 readline() on closed filehandle INFILE at /usr/lib/perl5/site_perl/5.8 +.0/Bio/Root/IO.pm line 440.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: How to avoid using array in concatenating string of multiple lines
by stajich (Chaplain) on Dec 10, 2004 at 21:11 UTC | |
by monkfan (Curate) on Dec 11, 2004 at 05:29 UTC | |
by stajich (Chaplain) on Dec 12, 2004 at 15:32 UTC | |
|
Re^3: How to avoid using array in concatenating string of multiple lines
by reneeb (Chaplain) on Dec 10, 2004 at 07:28 UTC | |
by monkfan (Curate) on Dec 10, 2004 at 08:57 UTC |