
I have learnt of something called the "bathtub" effect in the last year or two. A complex new product has a teething period during which support requirements are high. The requirement drops away (like - into a bathtub) as the product gets more mature, but then the curve rises again as the product becomes lief expired. In other words, maintenance is lowest midlife. It happens that this was taught to me about railway trains, but I see it elsewhere too.
A program can be written in a very longwinded way. We see that especially in a language like Perl, as written by newcomers converting from C who use few of the extra facilities and end up with a huge piece of code that's hard to maintain - "can't see the wood for the trees". It's sensible to shorten the code and use some of the new facilities - into the bathtub of less support - but then the code can end up getting so short that it's obtuse. Up goes the support aspect.
Look at your code and see where in the bathtub it lies!

The "pecking bird" is one of those water fed ornaments in which water drops into a container at one end of a balance. When the water holder gets full, the balance tips over and the water empties, so that the balance goes back for the next cycle. Translated into code? Let's say you want to print out 4 values per line - pour them into a Perl list using push, and have a print statement that tips them out and clears the list when there are the 4 values in there. The
Pecking Bird algorithm! (written 2007-06-07, updated 2008-09-16)
Associated topics are indexed as below, or enter http://melksh.am/nnnn for individual articles
P711 - An Introduction to Standards in Perl [242] Satisfaction of training - (2005-03-11)
[668] Python - block insets help with documentation - (2006-04-04)
[743] How to debug a Perl program - (2006-06-04)
[945] Code quality counts - (2006-11-26)
[965] KISS - one action per statement please - Perl - (2006-12-05)
[1047] Maintainable code - some positive advice - (2007-01-21)
[1345] Perl and Shell coding standards / costs of an IT project - (2007-09-11)
[1395] Dont just convert to Perl - re-engineer! - (2007-10-18)
[1555] Advanced Python, Perl, PHP and Tcl training courses / classes - (2008-02-25)
[1728] A short Perl example - (2008-07-30)
[1853] Well structured coding in Perl - (2008-10-24)
[1863] About dieing and exiting in Perl - (2008-11-01)
[2375] Designing your data structures for a robust Perl application - (2009-08-25)
[2688] Security considerations in programming - what do we teach? - (2010-03-22)
[2875] A long day in Melksham ... - (2010-07-17)
[3398] Perl - making best use of the flexibility, but also using good coding standards - (2011-08-19)
[4326] Learning to program - comments, documentation and test code - (2014-11-22)
P210 - Perl - Topicalization and Special Variables [493] Running a Perl script within a PHP page - (2005-11-12)
[639] Progress bars and other dynamic reports - (2006-03-09)
[969] Perl - $_ and @_ - (2006-12-07)
[1136] Buffering output - why it is done and issues raised in Tcl, Perl, Python and PHP - (2007-04-06)
[1232] Bathtub example - (2007-06-14)
[1289] Pure Perl - (2007-08-03)
[1444] Using English can slow you right down! - (2007-11-25)
[1508] How not to write Perl? - (2008-01-15)
[1704] Finding operating system settings in Perl - (2008-07-10)
[1705] Environment variables in Perl / use Env - (2008-07-11)
[1829] Dont bother to write a Perl program - (2008-10-10)
[1860] Seven new intermediate Perl examples - (2008-10-30)
[1922] Flurinci knows Raby Lae PHP and Jeve - (2008-12-04)
[2833] Fresh Perl Teaching Examples - part 2 of 3 - (2010-06-27)
[2876] Different perl examples - some corners I rarely explore - (2010-07-18)
[2972] Some more advanced Perl examples from a recent course - (2010-09-27)
[3449] Apache Internal Dummy Connection - what is it and what should I do with it? - (2011-09-19)
[4301] Perl - still a very effective language indeed for extracting and reporting - (2014-09-20)
[4395] Preparing data through a little bit of Perl - (2015-01-15)
[4682] One line scripts - Awk, Perl and Ruby - (2016-05-20)
[4700] Obfurscated code - it might work, but is it maintainable? - (2016-07-02)
Some other Articles
Perl - functions for directory handlingObject Relation Mapping (ORM)Asda opening large new store in MelkshamPerl, the substitute operator sBathtubs and pecking birdsfor loop - how it works (Perl, PHP, Java, C, etc)Judging the quality of contributed Perl codeSunday afternoonWhat are factory and singleton classes?Five of the best - pictures from London