Re: Best way to mix two lists

2009-07-11 Thread Matteo Riva
On Fri, Jul 10, 2009 at 9:25 PM, Gunnar Hjalmarssonnore...@gunnar.cc wrote: You can use a hash slice.   �...@{ $data{$key} }{ @fields } = split /:/, $val; Thanks Gunnar, your suggestion is enlightening. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail:

Best way to mix two lists

2009-07-10 Thread Matteo Riva
Hello everybody, I have two lists and I want to merge them like this: element 1 of list A, element 1 of list B, A2, B2, A3, B3, etc. I need this to create a sequence of key/value for an anonymous hash. I'm using this code: # @fields contains the names of the hash keys # $val is a

Re: Best way to mix two lists

2009-07-10 Thread Shawn H. Corey
On Fri, 2009-07-10 at 20:32 +0200, Matteo Riva wrote: Hello everybody, I have two lists and I want to merge them like this: element 1 of list A, element 1 of list B, A2, B2, A3, B3, etc. I need this to create a sequence of key/value for an anonymous hash. I'm using this code:

Re: Best way to mix two lists

2009-07-10 Thread Gunnar Hjalmarsson
Matteo Riva wrote: Hello everybody, I have two lists and I want to merge them like this: element 1 of list A, element 1 of list B, A2, B2, A3, B3, etc. I need this to create a sequence of key/value for an anonymous hash. I'm using this code: # @fields contains the names of the hash

Re: Best way to mix two lists

2009-07-10 Thread Jim Gibson
On 7/10/09 Fri Jul 10, 2009 11:32 AM, Matteo Riva mura...@gmail.com scribbled: Hello everybody, I have two lists and I want to merge them like this: element 1 of list A, element 1 of list B, A2, B2, A3, B3, etc. I need this to create a sequence of key/value for an anonymous hash.