Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: character-by-character in a huge file

by Zaxo (Archbishop)
on Apr 08, 2004 at 17:51 UTC ( [id://343681]=note: print w/replies, xml ) Need Help??


in reply to character-by-character in a huge file

You can read your whole window at once by setting $/ to a reference to it's literal constant width.

{ open (FH, "<ciona_fasta_two") or die $!; local ($/, $_) = (\500); while (<FH>) { my ($first, $last) = (substr($_,0,1), substr($_,-1,1)); # do other stuff } close FH or die $!; }

After Compline,
Zaxo

Replies are listed 'Best First'.
Re: Re: character-by-character in a huge file
by bart (Canon) on Apr 09, 2004 at 11:29 UTC
    That's not a sliding window.

      It is with seek.

      After Compline,
      Zaxo

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2024-04-18 10:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found