Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: varaible to filehandle -alack!

by Crackers2 (Vicar)
on Oct 28, 2010 at 20:19 UTC ( #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}} "$_"; }


Comment on Re: varaible to filehandle -alack!
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2014-09-19 00:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (129 votes), past polls