Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: pattern matching to seperate data

by snopal (Pilgrim)
on May 03, 2009 at 13:43 UTC ( #761580=note: print w/replies, xml ) Need Help??


in reply to pattern matching to separate data

This looks like homework to me so I'll make suggestions rather than code

1) Filehandles can be stored in variables too:

my ($fh1, $fh2); open $fh1, ">GENEID.out" or ... open $fh2, ">PROTID.out" or ...

2) Read every line - print every line. You are obviously not doing that.

3) set another Filehandle var '$fh' with the appropriate Filehandle as you detect a change and use your new $fh to store and print to the right file.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2021-03-02 09:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favorite kind of desktop background is:











    Results (42 votes). Check out past polls.

    Notices?