Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: writing array element to a file

by francesca1987 (Initiate)
on Apr 25, 2013 at 13:10 UTC ( [id://1030665]=note: print w/replies, xml ) Need Help??


in reply to Re: writing array element to a file
in thread writing array element to a file

Hi baxy! I did as you suggested in the update, the script run, but the output was empty! I run:
use strict; use warnings; my $infile = "rep_set_ass_tax.fna"; my $outfile = "seq_id.txt"; open(IN, ">>", "rep_set_ass_tax.fna") or die "Died!!"; while (my $line=<IN>) { if($line=~/>(\d+)/) { print $1 . "\n"; } }
What's the problem?
close IN;

Replies are listed 'Best First'.
Re^3: writing array element to a file
by poj (Abbot) on Apr 25, 2013 at 14:16 UTC
    This opens IN for output
    open(IN, ">>", "rep_set_ass_tax.fna") or die "Died!!";
    it should be
    open(IN, "<", "rep_set_ass_tax.fna") or die "Died!!";
    poj

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1030665]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2024-04-19 17:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found