http://qs321.pair.com?node_id=212091


in reply to Maintainable Code?

The only problem with hashes (and hashes of hashes) is that they are seen as "advanced" and noone talks about them until way to late, when the programmer already needs to use... composite data structures. In Perl you (as usual) have to make these for yourself using hashes.

I remember learning Perl. Until someone mentioned hashes when I asked for data structures, I thought that there was no such thing in Perl! The next, mountain like, hurdle was the syntax for dereferencing complex data structures (and subs returning e.g. hashrefs).

Explain these concepts by example and you don't have a problem.


/J

Replies are listed 'Best First'.
Re: Maintainable Code?
by Abigail-II (Bishop) on Nov 12, 2002 at 16:48 UTC
    When I teach a Perl course, I tell them about arrays and hashes on the afternoon of the first day. Even before control structures like if and while (that's the morning of the second day).

    And in the morning of the first day, we talk about the history of Perl, the manual, CPAN, the manual, mailing lists, the manual, websites, use strict, the manual, use warnings, the manual, and how to run a Perl program. Oh, and how to use the manual of course.

    Abigail