Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Genbank file parsing

by EdwardG (Vicar)
on Jan 11, 2005 at 13:04 UTC ( [id://421265]=note: print w/replies, xml ) Need Help??


in reply to Genbank file parsing

You might find it easier if your consider the file as a long string, one that happens to contain embedded newline characters.

my $data = do {local $/; <DATA>}; my @items = map { { 'name' => $1, 'niceinfo' => $2 } } ($data =~ /^FEATURES(.+?)^ORIGIN(.+?)^\/\//msg);

 

Replies are listed 'Best First'.
Re^2: Genbank file parsing
by blazar (Canon) on Jan 11, 2005 at 14:03 UTC
    You might find it easier if your consider the file as a long string, one that happens to contain embedded newline characters.
    IMHO this qualifies as a particularly bad answer since he specifically pointed out that his file is large and it is always recommended not to slurp large files all at once if possible. Now I don't see anything here that suggests this to be necessary...

      It depends just how large the file is, how much memory is available, and other various trade-offs. But you are probably right in general, although I would quibble about "particularly bad" :-/

       

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2024-04-16 18:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found