Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
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
Domain Nodelet?
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 lurking in the Monastery: (None)
    As of 2021-10-17 01:46 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      My first memorable Perl project was:







      Results (70 votes). Check out past polls.

      Notices?