IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Sorry for not responding in this thread earlier
I've been distracted...

Well I also once had a reply all typed up, and the power went out. :-(

As others have indicated, it is better to approach Perl thinking linguistically rather than in terms of data. In one line Perl's attitude can be summed up by, "Perl tries to DWIM." Here's a quick overview of Perl's overall attitude towards data:

  • A thing is a scalar. Scalars can hold any kind of thing, strings, floating point numbers, integers, references, etc. Perl may do implicit casts behind the scenes at any time.

  • You usually hold a list of things in an array. An array in scalar context gives you the number of elements in the array. An array in list context gives you the elements. You can access any one with subscripting. You can also push, pop, shift, unshift, and splice into the array.

  • An "of relationship" is held in an associative array, which everyone just calls a hash (because that is how it is implemented).


The gruesome details can be found in [link|http://www.perldoc.com/perl5.8.0/pod/perldata.html|perldata].

There are corners of the language which don't fit in this simple model. For instance filehandles. Over time those are being cleaned up, for instance as of Perl 5.6 you can just use a private scalar as a filehandle and it just works.

That said the issue isn't generally the data structure - that is pretty simple - it is knowing what Perl is planning to do with it. And that is all linguistic. Rather than give you a tutorial on that, I'll just respond to each of your posts that shows some confusion.

Cheers,
Ben
I have come to believe that idealism without discipline is a quick road to disaster, while discipline without idealism is pointless. -- Aaron Ward (my brother)
New No worries.
When you did not respond in the first 24 hours, I was a bit worried.

Then your announsment came, and my conclusion was: this man has his priorities straight :)
--

This guy's ahead of his time! He's using quantum programming methods: in universes where invalid data is passed to this function, it does not return. Thus you are ensured that you will only have valid data after calling it. Optimally you'd destroy the universe on failure, but computers haven't quite advanced to that level yet.

-- [link|http://thedailywtf.com/archive/2004/10/26/2920.aspx|The] Daily WTF

New :-)
I have come to believe that idealism without discipline is a quick road to disaster, while discipline without idealism is pointless. -- Aaron Ward (my brother)
     One line description of data model for Perl - (Arkadiy) - (33)
         Yep, you got it right. - (admin) - (1)
             You're not helping - (Arkadiy)
         Perl: Everything is... - (ChrisR)
         Over simplifying - (broomberg) - (1)
             linquistic versus data personalities - (tablizer)
         To pick up from what Barry said. - (static) - (4)
             No, everything is whatever Barry needs it to be - (Arkadiy) - (3)
                 The logic - (ben_tilly) - (2)
                     Keys... - (Simon_Jester) - (1)
                         Tie is NOT a module (and it sucks) - (ben_tilly)
         Well, Lisp - everything is a list or an atom... - (Simon_Jester) - (18)
             Atonm, list, hash... - (Arkadiy) - (17)
                 References are essentially pointers - (broomberg) - (7)
                     I am not trying to build anything in particular just now - (Arkadiy) - (6)
                         some answers - (cforde) - (5)
                             OK, another arbitrary distinction to remember - (Arkadiy) - (4)
                                 It's easy enough to test... - (Simon_Jester) - (2)
                                     Yes it is easy to test. - (Arkadiy) - (1)
                                         Testing has some disadvantages.... - (Simon_Jester)
                                 It isn't arbitrary - (ben_tilly)
                 References: pointers in languages that don't have pointers -NT - (FuManChu)
                 okay...look at it this way.... - (Simon_Jester)
                 PERL DOES NOT STORE LISTS!!! - (ben_tilly) - (6)
                     OK, in that case, what is (a,b,c) ? - (Arkadiy) - (5)
                         In which context? - (ben_tilly) - (4)
                             In the context of grammar and syntax - (Arkadiy) - (3)
                                 Simple answer: there is no syntactic difference - (ben_tilly) - (2)
                                     OK, I think I get it. - (Arkadiy) - (1)
                                         Yup, sounds like you've got it - (ben_tilly)
         lets try another viewpoint - (daemon)
         Sorry for not responding in this thread earlier - (ben_tilly) - (2)
             No worries. - (Arkadiy) - (1)
                 :-) -NT - (ben_tilly)

Must be what keeps your hair up.
97 ms