Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: varaible to filehandle -alack!

by Crackers2 (Parson)
on Oct 28, 2010 at 20:19 UTC ( [id://868139]=note: print w/replies, xml ) Need Help??


in reply to varaible to filehandle -alack!

I suspect you want something like this:

use strict; open my $ALUS, "Z:\\3\' UTR intron project\\Alu_bed.bed" or die "Coul +dn't open alus: $!"; my %seen; while (<$ALUS>){ /(chr.*?)\t/ or next; if (! exists $seen{$1}){ open my $fh, ">", "Z:\\3\' UTR intron project\\Alu_chroms\\$1.tx +t"||die "couldn't open $1 file!"; $seen{$1} = $fh; } print {$seen{$1}} "$_"; }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2024-03-19 04:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found