http://www.perlmonks.org?node_id=1217259


in reply to Re^2: Any downsides to this slurp idiom?
in thread Any downsides to this slurp idiom?

That sounded plausible, but I just tried it on 5.22 with these results, using this code in my repl:

{ my $s; do{ local( @ARGV, $/)='1gb.db'; $s = <> }; <STDIN>; my $t = do{ local( @ARGV, $/)='1gb.db'; <> }; <STDIN> };;

Note how the first bump in the memory to 1.2GB remains at that level after the first burst of IO finishes,

It then climbs to 2.4GB for the second burst of IO, and then climbs again to 3.5GB immediately the IO stops.

Ie. When the temporary buffer within the do block is copied into the target scaler $t.

(Perhaps the IsCOW only operates on *nix? (I'm on win.)


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". The enemy of (IT) success is complexity.
In the absence of evidence, opinion is indistinguishable from prejudice. Suck that fhit