http://www.perlmonks.org?node_id=1228112


in reply to Advice for Perl teaching

It's a little difficult to guess what kind of things might be necessary to read Perl, but I think the most useful skill would be the ability to read variables and understand what kind of data structure is bring manipulated. Thus, I'd start with these three groups:

All this so that they can differentiate between $foo, $foo[0], and $foo{'zero'}, as well as $foo[0] and $foo->[0]. (The latter expression can be written as $$foo[0], but to me, that's much harder for the eye to pick up.)

Picking the correct data structure is a pretty critical piece in solving a programming challenge. I used three parallel arrays in a recent solution, and the code worked incorrectly -- so I had to take a step back and re-think, and finally realized I needed a HoA. The final code was really quite elegant, and was a breeze to write.

Alex / talexb / Toronto

Thanks PJ. We owe you so much. Groklaw -- RIP -- 2003 to 2013.

Replies are listed 'Best First'.
Re^2: Advice for Perl teaching
by Zenzizenzizenzic (Pilgrim) on Jan 07, 2019 at 22:50 UTC
    Yes, I suspect the hardest part, at least for the scripts I'm familiar with will be the variable types. Thank you!