in reply to How to preserve values outside a sub
If you do that, then you get:pass1({ params => {%$hashref} }); # {%$hashref} makes a (shallow) cop +y of the hash '$hashref' # points to and creates a new ref t +o it.
which is what I think you expect.before pass1: 1 Inside pass1... 2 3 after pass1: 1
Added (shallow) note, AnomalousMonk is correct in his reply below!
|
---|