in reply to Helping Beginners

When I first saw the Schwartzian transform it took me a while to just decipher it (ok, I'm getting old). I was writing similar code (i.e. calculating sort fields once rather than during each compare), but obviously I was using a lot of intermediate arrays & hashes. It probably ran almost as fast (and certainly fast enough for me). I didn't learn how to sort with the transform, nor how to optimize, but rather how to unhinge my brain from writing in C and think of the problem totally differently, in perl.

If I were teaching sorting to a beginner, I'd teach them how to write a compare function. The first one would probably just (inefficiently) parse each line each time it was compared. After that I'd piecemeal a transform using intermediate arrays. Then if they could grok that I'd finally present the transform in it's simplest form (i.e. each element would look somethine like

[ $sortable_date, $original_string ]
In certain limited forums I think "baby Perl" is ok. Books, tutorials, college classes are all appropriate for this. Past that they should be expected to use the available resources (or be pointed to them). It just amazes me that folks actually interview for jobs that they would be, not just slightly, but totally incompetent in. These people just don't have the "right stuff". The "right stuff" here isn't knowing perl or being a programming guru. It's the drive that pushes you to learn about it, and the mental ability to actually be able to apply some of it from time to time.

bluto