[Israel.pm] Talk proposal: Moving from script to module: Modularization of a command line script

Shlomi Fish shlomif at iglu.org.il
Thu Jan 13 08:03:32 PST 2011


On Thursday 13 Jan 2011 09:38:29 Gabor Szabo wrote:
> I won't be able to come to the January meeting of the TelAviv.pm but I'd
> like to offer the following talk to the next meeting I can participate on:
> 
> Moving from script to module: Modularization of a command line script
> 
> Most people when they first learn Perl they start by writing small scripts.
> Those scripts then grow and grow. Then they need another script that does
> something different but with certain similarities.
> Then they copy and paste parts of the original script. Now they have
> duplicated code. This then happens over and over again till they have
> lot of scripts with some common code.
> 
> When time comes to change some code in the "common" part they now need
> to go over many scripts and make that change.
> 
> In this talk I'll take a script and see how can take some parts of it
> move to a module so that we can use the same piece of code
> in many scripts without copy-paste.
> 
> I think the length of talk is somewhere between 30-40 minutes.
> 
> Any comments? Ideas?

I'd be happy to hear such a talk, as I myself converted several of my scripts 
into modules in the past. One example for that is what became
http://search.cpan.org/dist/Games-LMSolve/ and a more recent example is
http://search.cpan.org/dist/Games-ABC_Path-Solver/ . 

In the latter case, I first wrote it as a script that used a global variable 
for storing the ongoing truth table used in the deduction process. However, 
then I realised that some games ended up in a non-determined case, which 
required to guess all possibilities in turn and see which ones yield good 
solutions and which ones do not. So I ended up converting it to a class and an 
object. But I guess that's 
http://en.wikipedia.org/wiki/You_ain%27t_gonna_need_it for you.

Regards,

	Shlomi Fish

-- 
-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
Freecell Solver - http://fc-solve.berlios.de/

Chuck Norris can make the statement "This statement is false" a true one.

Please reply to list if it's a mailing list post - http://shlom.in/reply .


More information about the Perl mailing list