What does $/ means at all?

ambs on 2004-01-05T21:38:04

I need to process files. These files are big! The type of process cannot be done line by line. But it can be done using small chunks. Then, why not define $/ and read chunk at a time?

It seemed to be a good solution, but perl uses too many memory (although chunks are 300 bytes long).

An elegant solution which does not works... let think in another one...


Read perlvar

runrig on 2004-01-06T00:02:44

You are perhaps setting "$/ = 300;" when you should be setting $/ = \300;. With the former, "<>" thinks the string "300" is the line terminator (so you could get very large chunks). The latter reads 300 bytes at a time.