## #perl - Fri 27 Apr 2007 between 14:59 and 15:11

### NY Lost Funds

 subichan this is driving me crazy. integral No, it doesn't. Yaakov One is a two element list, one is four. integral An array has order (the order from it's indices). Hashes are not ordered by their keys. buetow (1, "hi" => 2, "bye") # works too i think integral He missed '='s or something.buetow: That's right!=> is just magic pixie dust, it's really a ,. subichan yeah i missed '='s sorry buetow (1 => "hi" => 2 => "bye") # ;) subichan that's what i've typed there buetowno? integral no.Consider using a large font. buetow subichan: after the (.....) is assigned to an %hash or an @array, its no more the same Yaakov eval: @a=qw/hi bye/; %h=@a; \@a; \%h buubot Yaakov: {hi => 'bye'} integral In someways, you can think of an array as a box that contains a list. Like a scalar variable is a box that contains a scalar value. Yaakov eval: @a=qw/hi bye/; %h=@a; print for @a; \%h buubot Yaakov: hi bye {hi => 'bye'} integral TBH, I guess if subichan wants a *big* obvious difference between arrays and hashes, order is the thing action CPAN rating: CGI-Ajax rated 2 stars by Aristotle Pagaltzis CPAN rating: CGI-Ajax rated 2 stars by Aristotle Pagaltzis subichan i don't understand the concept of order. i just understand that the assignments up there make groups of values keyed by 1 and 2 in both cases integral Oh dear, an anarchist. subichan hahano really, what do you mean by ordered?ordered in memory?phisically? integral You can write code which processes them in a well defined order.Err, well, stronger than that, but that's okay for a start. subichan oh..ok thanks.. it's starting to make sense.. action integral & dinner, food integral & dinner, food subichan thanks integral, have a good dinnerso basically keys in arrays are deduced by order but are not phisically stored in any variable, whereas hash key values do ? Ani-_ a hash has keys, an array has indexes. Yaakov eval: @a=qw/hi bye no yes/; %h=@a; print for @a; \%h buubot Yaakov: hi bye no yes {hi => 'bye',no => 'yes'} subichan Ani-_: what are indexes? buetow subichan: an index is an integer number