Skip to main content

Posts

Showing posts from August, 2010

Programming: the first thing to learn

Many of us had courses, attended lectures and speeches on programming. Many of us read (even many) programming books, and regularly read articles and blogs about programming. Have you ever thought of what should have been the first thing to learn in programming? The usual "variables, operators, data structures, classes, templates, metaprogramming, ..." or something else? I've come to the conclusion that the most important thing, the first thing to learn, the one that if you're not familiar with you shouldn't even keep studying programming, is the answer to this question: "How can I verify my code works?" . If I was a teacher, right before writing my name on the blackboard (yes, this is how I like it to imagine it), I'd write this: "How can I verify my code works?". And I'll spend the entire lesson waiting for someone to come up with a reasonable solution. If nobody goes close to it, I'd assign it as an essay for the following lesson...

Perl modules: from a new idea to a debian package in one minute

Time ago I wrote something about debianizing a perl module . If you're not applying it to a tar downloaded from CPAN or in general a third party module, but on your own module, then you may find it useful to build the module's dir structure using module-starter (installed with libmodule-starter-perl). The CPAN page for module-starter contains a simple description on how to use it and this post has interesting comments on even easier ways to achieve the same result (using dzil for example). In summary this is what you need to do: $ module-starter --module=My::AModule --author="Giacomo Vacca" --email="giacomo.vacca@email.email" --builder=Module::Install Inside the created dir (My-AModule): $ perl Makefile.PL $ make $ make test (I'm not running make install on purpose) Outside of My-AModule: $ dh-make-perl My-AModule/ (builds the debian dir using the current configuration) Inside My-AModule: $ debuild or $ debuild -us -uc if you don't want to sign ...