[tpm] Subroutines and modules

Chris Jones cj at enersave.ca
Sat Mar 9 05:17:45 PST 2013


At 05:01 PM 06/03/2013, arocker at Vex.Net wrote:
>Following our discussion last week, I've prepared a simple example of
>refactoring repeated code, (naive), first to a subroutine, (subro), then
>to a module (Counter.pm) used by a program (counts).
>
>I'm courting public humiliation by publishing them. (See the attached.)
>The first 2 are easy to run, but "counts" requires Counter.pm to be in one
>of the directories named in @INC.
>
>In every case, the result should be:
>Number is 4
>Number is 5
>
>The programs are pretty useless in themselves, but I wanted to concentrate
>on the essential points.

Thank you, that provides great direction.



 >>
Christopher Jones, P.Eng.
Suite 1801, 1 Yonge Street
Toronto, ON M5E1W7
Tel. 416-203-7465
Fax. 416-946-1005
email cj at enersave.ca
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/toronto-pm/attachments/20130309/a2579f5c/attachment.html>


More information about the toronto-pm mailing list