Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Re: Multiple references pointing to the same memory location

by bwana147 (Pilgrim)
on Jul 31, 2001 at 13:10 UTC ( [id://101103]=note: print w/replies, xml ) Need Help??


in reply to Re: Multiple references pointing to the same memory location
in thread Multiple references pointing to the same memory location

Be careful here: the OP wanted a list of array refs, each one containing a row of data. If you push(@entries, @$columns_ref), you'll end-up with @entries being a flat list of all the columns, without any way of knowing where each row starts or ends. You really must create a new array, copy the values from the array referenced by $column_ref and push a reference to the new array. This can be done easily, as has already been pointed out:

push(@entries, [ @$columns_ref ]);

--bwana147

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2024-04-20 03:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found