Re: Analize Java source file with perl?



Ovid schreef:

my $text = do { local $/; <$fh> };

There is a problem with this idiom: it uses about twice the memory of
this variant:

my $text ; { local $/ ; $text = <$fh> }

So if your files can be big (related to the amount of memory available),
use the latter.

--
Affijn, Ruud

"Gewoon is een tijger."

.



Relevant Pages

  • Re: moving data from one place to another in a text file
    ... practical solution - as any solution requiring "memory allocation" canNOT handle ... And, of course, the "read twice method" would be portable to EVERY ANSI/ISO ... >>output the same input file with another name. ...
    (comp.lang.cobol)
  • Re: SLOW typing response time using Mac Office 2008
    ... Anything running on a PPC needs twice the memory of something running on ... Which occupies twice the memory. ... and noticed a marked improvement in the response time, ... But I usually have Safari 3.0.4 running in the background, ...
    (microsoft.public.mac.office.word)
  • Reasons For 64-bit: A Digest
    ... First of all, you are of course, absolutely right about your observation that a 64-bit Pointer is twice the size of a 32-bit pointer. ... I really wish the "64-bit Lobby" had made a digest of our arguments while we were fighting to get a native 64-bit compiler on the Road Map.. ... twice as many registers: double the number of general purpose registers and double the number of XMM registers. ... Expanded address space so instead of being limited to 4 GB of memory you're limited to terabytes of memory. ...
    (borland.public.delphi.non-technical)
  • Re: WWDC -- MacBook Pro?
    ... twice as big. ... consume extra memory and cache ... cache causing more cache invalidates, and a when a cache line is ... As this program rewriting happens, the 32-bit computers will die away from ...
    (comp.sys.mac.system)
  • Re: Real cost of the mini
    ... >> cost of a PC that has double the HD space, twice the CPU power, 4x the video ... >> memory and twice as much ram you will ever need. ... > is a serious memory hog that realistically needs 1GB, ... system B's preconfigured model. ...
    (comp.sys.mac.advocacy)