August 2012 Archives

Extensible Maintainable Subroutines and Methods

To make my subroutines and methods more reusable, extensible, and maintainable, I make them receive a hash reference as their only argument and return a hash reference. This has multiple benefits.

First, the parameters going into the subroutine are named when passed in, and these names are used to identify them inside the subroutine. This means that new parameters can be added with keys in the hash, a very minimal change.…

About Andrew Proper

user-pic I've been writing in Perl since my first Perl job in 1999. I must say, Perl has been good to me and is my favourite programming language. Currently I'm an Applications Developer and Perl is the primary language I use.