Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^3: Any downsides to this slurp idiom?

by Your Mother (Archbishop)
on Jun 22, 2018 at 18:22 UTC ( #1217244=note: print w/replies, xml ) Need Help??


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

I'm sorry to ask but I'm interested and not sure I follow. Are you saying that BrowserUk's two examples are equivalent in the background with 5.20 and up? Copy on write being used to make the "temporary" data the same as the scalar's?

  • Comment on Re^3: Any downsides to this slurp idiom?

Replies are listed 'Best First'.
Re^4: Any downsides to this slurp idiom?
by vr (Curate) on Jun 22, 2018 at 18:40 UTC

    Correct. I'm observing, right now, memory consumption reading 400 MB file using both examples, both in 5.18 and 5.20. And trying to read 800 MB file results in "Out of memory!" (32-bit OS) with 5.18 and $s = do{...}; syntax, but not in other 3 cases. I said "somehow" because scalar doesn't get "IsCOW" flag, but mechanism (do not copy a buffer PV points to) must perhaps be the same.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2021-10-24 09:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (89 votes). Check out past polls.

    Notices?