Tuesday December 24, 2002
11:01 AM
Perl as modules
so I'm doing a proposal review for (yet another) generic Perl book (actually, it would be repackage of one that's already out there, but everyone needs to go through the motions anyway). one of the things that struck me while looking over the TOC was that the chapter on file handling discusses Perl's built-in functions almost exclusively - modules like IO::File are left to a chapter on standard modules.
When I really sat down to analyze this, it actually bothered me quite a bit (though it's not the author's fault). Are there any books that teach Perl as a language and include standard modules from the start? Do they discuss localtime right alongside the core Time:: modules, core Text:: with string manipulation, Test:: with "how to write a Perl program"? I admit it's been a very long time since I've actually looked at a beginning Perl book, but making core modules just an aside seemed like a real disservice to novices all of a sudden.
Modules for begineers (Score:2)
Similar thoughts occurred to me. I'm coaching a beginner in Perl. We've done all the usual stuff, files, arrays, hashes, matches, regexes etc. and I'm just wondering when and how to introduce modules. IMHO most books leave it too late - and drop it in just when the reader is starting to feel confident and WHAM! - but put it in too early when the reader is just beginning to understand and WHAM!WHAM!
I also think it is a mistake to tie it
Re:Modules for begineers (Score:1)
and yes, modules do not (necessarily) equal OO. A good example is
File::Specwhich provides both functional and OO interfaces. modules as libraries is really the direction I was headed - for OO stuff Object-Oriented Perl is the best resource and there's no reason to try and repeat that work again.