Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.perl.misc > #4640

Re: references (4567890)

From tmcd@panix.com (Tim McDaniel)
Newsgroups comp.lang.perl.misc
Subject Re: references (4567890)
Date 2012-03-06 17:49 +0000
Organization Tim McDaniel's at Panix
Message-ID <jj5in0$dah$1@reader1.panix.com> (permalink)
References <4f4fcdba$0$1386$4fafbaef@reader2.news.tin.it> <4f50d85e$0$1390$4fafbaef@reader2.news.tin.it> <jiqvf2$6k4$2@reader1.panix.com> <4f54abca$0$6928$e4fe514c@news2.news.xs4all.nl>

Show all headers | View raw


In article <4f54abca$0$6928$e4fe514c@news2.news.xs4all.nl>,
Dr.Ruud <rvtol+usenet@xs4all.nl> wrote:
>On 2012-03-02 18:19, Tim McDaniel wrote:
>
>> In fact, I did want a "ref slice" a few days ago.  I had an array of
>> refs and I wanted the ID key out of all of them.  I wanted to do
>>      @arr->{ID}
>> but Perl doesn't allow that; I had to code it more verbosely as
>>      map { $_->{ID} } @arr
>
>Parallel arrays are bad, go for matrices.

I'm not sure what you mean.  For one thing, Perl doesn't have matrices
per se.

Also, I don't necessarily get to choose the data structures.  In this
case, it was a SQL interface that returned a ref to an array, where
each array element was a ref to a hash of the form COLUMNNAME =>
VALUE.  If I want some other representation, then I have to haul out
map, foreach, or whatever to restructure it.

-- 
Tim McDaniel, tmcd@panix.com

Back to comp.lang.perl.misc | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

references (4567890) Kiuhnm <kiuhnm03.4t.yahoo.it> - 2012-03-01 20:27 +0100
  Re: references (4567890) Ben Morrow <ben@morrow.me.uk> - 2012-03-01 20:48 +0000
    Re: references (4567890) Kiuhnm <kiuhnm03.4t.yahoo.it> - 2012-03-02 15:25 +0100
      Re: references (4567890) Ben Morrow <ben@morrow.me.uk> - 2012-03-02 16:05 +0000
      Re: references (4567890) tmcd@panix.com (Tim McDaniel) - 2012-03-02 17:19 +0000
        Re: references (4567890) "Dr.Ruud" <rvtol+usenet@xs4all.nl> - 2012-03-05 13:04 +0100
          Re: references (4567890) tmcd@panix.com (Tim McDaniel) - 2012-03-06 17:49 +0000
            Re: references (4567890) Kiuhnm <kiuhnm03.4t.yahoo.it> - 2012-03-07 01:21 +0100
            Re: references (4567890) "Dr.Ruud" <rvtol+usenet@xs4all.nl> - 2012-03-07 22:11 +0100
    Re: references (4567890) "C.DeRykus" <derykus@gmail.com> - 2012-03-08 23:26 -0800
      Re: references (4567890) Kiuhnm <kiuhnm03.4t.yahoo.it> - 2012-03-09 11:55 +0100
        Re: references (4567890) "C.DeRykus" <derykus@gmail.com> - 2012-03-09 08:55 -0800
          Re: references (4567890) Ben Morrow <ben@morrow.me.uk> - 2012-03-09 18:27 +0000
            Re: references (4567890) "C.DeRykus" <derykus@gmail.com> - 2012-03-09 11:29 -0800
              Re: references (4567890) Ben Morrow <ben@morrow.me.uk> - 2012-03-09 20:53 +0000
                Re: references (4567890) "C.DeRykus" <derykus@gmail.com> - 2012-03-09 21:00 -0800

csiph-web