On Mon, 26 Jul 2004, Wiggins d Anconia wrote:
On Mon, 26 Jul 2004, Gregoire Hostettler wrote:
I already spent more than 20 hours for something which should take 30 minutes....
[....]
Looks like Perl is not able to handle trivial data structure like an array of records (or hashes).
Sure it can, and trivially. Most introductory Perl books, along with standard references like _Programming Perl_ ("the Camel Book"), will have a section on how to handle arrays of hashes & related structures. If you're already a seasoned programmer, maybe that book or the _Perl Cookbook_ will provide you with a good crash course in how to get up to speed in writing idiomatically correct Perl.
That said, ...
Don't sell Perl short because you have not given it enough time to learn. The reason this is complicated for you isn't Perl's problem, it is lack of time taken to learn its fundamentals
Now hang on, he said he's been working on this for 20 hours, but he's right in that it should take no more than 30 minutes -- and for someone comfortable with the language, far less than that even. Be nice on the poor, scarred C programmer, he's fighting against his own inertia :-)
Gregoire, if you can get your hands on a copy of _Programming Perl, 3rd Edition_, take a look at chapter 9, "Data Structures". Section 9.3 has a brief overview of composing, generating, and accessing arrays of hashes. If you would like brief samples, please let me know off-list, as this isn't relevant to the Advocacy list & I'm don't currently subscribe to the Beginners list.
-- Chris Devers
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>