Jun 20, 2000, 6:15 PM
Post #4 of 4
If I read your original question right, my first example (array of arrays) would do
Re: Combining two arrays to for a md-array
[In reply to]
@jl = ( [ "Jack", "James", "Carl" ], [ "Josh", "Jim" ] );.
Sure you could unshift, but what's the point? All the following would be the same functionally.
<BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR>
@jl = ( [ @j ], [ @l ] );
# unshift ( lazy )
unshift( @jl, [ @j ], [ @l ] );
# unshift ( verbose )
unshift( @jl, [ @l ] );
unshift( @jl, [ @j ] );</pre><HR></BLOCKQUOTE>
Your afternote (about "importing") confused the intent, but which my second example (array) would do @jl = ( "Jack", "James", "Carl", "Josh", "Jim" );.
No dereferencing needed for this second one, but nor can you extract the original arrrays easily.
Unless you start using other structures (ie, a hashes), I don't see any other way for you to do this.
Perhaps if you explained exactly what you're trying to do I could answer the question you meant instead of the question(s) you asked.
[This message has been edited by Kanji (edited 06-20-2000).]