Taking the lead, not the dog, for a walk.

When I say that "I'm taking the dogs for a walk", I don't literally carry the dogs for a walk - they walk themselves and I just hold the leads.
Statement of the obvious?
Yes!
But you would be surprised how many programmers pass complete full data structures into named blocks of code - "subroutines" - rather than just passing the address / a refernce to the data structure which is rather like the dog's lead. Th etemptation to pass data in this inefficient way is particularly stong in Perl where
domysub(@info);
passes a complete second copy of the data in the list in @info to the sub, whereas
domysub(\@info);
would simply pass in a reference - lightweight, like the dog leads - even though the dogs shadowed here weigh 31kgs and 36kgs.
Our
Perl Courses go into this subject in a much more through way - not only do we teach you Perl, but we teach you to write
good Perl. Next course - 6 weeks time ... places still available!
(written 2012-10-28, updated 2012-11-03)
Associated topics are indexed as below, or enter http://melksh.am/nnnn for individual articles
Z203 - Cat and Dog [62] Technical Open House - (2004-09-25)
[96] Variable Scope - (2004-10-22)
[547] Taking the dog for a walk - (2005-12-29)
[744] We can offer a room, but we can't operate on a dog - (2006-06-05)
[771] From cat breeder to Cobol to Perl - (2006-06-21)
[2029] Also for the eyes of the cat - (2009-02-07)
[2132] Learning about Lurchers - (2009-04-18)
[2138] Ski bore ... train bore ... dog bore - (2009-04-24)
[2140] Beware - giving copyright away when you upload a picture - Dogs Trust - (2009-04-25)
[2167] Watching the tele - (2009-05-10)
[2252] Leaping dog, Leaping horse, copyright of old masters - (2009-06-20)
[2271] Dogs Trust, Dog Show, Newbury - (2009-07-06)
[2295] The dog is not in trouble - (2009-07-17)
[2450] Family Gathering at 404, The Spa - (2009-10-11)
[2451] Gypsy says - (2009-10-12)
[2456] Bright Eyes - (2009-10-16)
[2496] A better design of mouth - (2009-11-07)
[2499] ourdog is Greyhound, Staffie and Ginger Cake - (2009-11-09)
[2555] Bookkeeping - (2009-12-29)
[2689] Can my dog eat potatoes? Doggie Dietary Research, and political sleaze! - (2010-03-23)
[2787] Sleeping in on Sunday - (2010-05-30)
[2897] The Land of the Black Labrador - (2010-08-01)
[3096] Contrast in pictures - (2010-12-20)
[3324] Rabbit Shelter - (2011-06-12)
[3338] Return trip - Dogs Trust, Newbury - (2011-06-27)
[3530] A typical weekend?? - (2011-11-28)
[3533] No message - just doggy pictures of the new doggy - (2011-11-30)
[3537] Letting the foster parents know ... too little or too much? - (2011-12-04)
[3541] I loves Melksham - (2011-12-06)
[3553] Changes to morning routines - (2011-12-16)
[3561] Happy Christmas ... a Christmas morning walk in Melksham - (2011-12-25)
[3606] Gypsy and Billy enjoy the snow - (2012-02-10)
[3625] An update on Billy the Greyhound and Gypsy the Lurcher - (2012-02-25)
[3674] Off to walk the dogs - (2012-03-30)
[3675] Spring 2012 - (2012-03-30)
[3737] Postcards from Barmouth - (2012-05-20)
[3908] Black dogs at Halloween - (2012-10-31)
[3920] Challenge for a photographer - (2012-11-10)
[3936] Lisa is home today ... - (2012-11-26)
[3943] With us for a year already! - (2012-12-03)
[4016] Red, yellow, green or pink dog? Yellow Dog Project - (2013-02-23)
[4130] Soft furnishings up a Welsh Mountain - (2013-07-03)
[4180] Exceptionally, I sign a petition - on a life and death issue for Irish dogs - (2013-09-20)
[4189] Who are we - Lisa, Graham, Gypsy and Billy - (2013-10-07)
[4316] Too many Staffies, too many lurchers - (2014-11-16)
[4333] Misty Melksham Morning - (2014-11-30)
[4417] Crisp morning, fast run - (2015-02-06)
[4433] Different views of a Welsh Valley - but headed home - (2015-02-20)
[4507] In favour of adoption rather than puppy purchase - dogs! - (2015-06-07)
[4517] Black dog day - and Bobby still seeks his new home - (2015-09-26)
[4526] Day trip to Lancaster - (2015-10-10)
[4666] Spring at Well House Manor - (2016-03-27)
P217 - Perl - More than Simple Lists and Hashes! [43] Hash of lists in Perl - (2004-09-09)
[293] Course follow-ups - (2005-04-27)
[1514] Autovivification - the magic appearance of variables in Perl - (2008-01-21)
[2241] Perl references - $$var and \$var notations - (2009-06-15)
[2840] Just pass a pointer - do not duplicate the data - (2010-06-30)
[2877] Further more advanced Perl examples - (2010-07-19)
[2996] Copying - duplicating data, or just adding a name? Perl and Python compared - (2010-10-12)
[3007] Setting up a matrix of data (2D array) for processing in your program - (2010-10-21)
[3072] Finding elements common to many lists / arrays - (2010-11-26)
[3105] Adventure with references to lists and lists of references - (2010-12-26)
[3118] Arrays of arrays - or 2D arrays. How to program tables. - (2011-01-02)
[3399] From fish, loaves and apples to money, plastic cards and BACS (Perl references explained) - (2011-08-20)
[3406] Not multidimentional arrays - but lists of lists. Much more flexible. Perl! - (2011-08-26)
[3444] Take the dog on a lead - do not carry her. Perl references. - (2011-09-17)
[3577] How to do multidimensional arrays (or rather lists and hashes) in Perl - (2012-01-14)
P208 - Perl - Lists [28] Perl for breakfast - (2004-08-25)
[140] Comparison Chart for Perl programmers - list functions - (2004-12-04)
[230] Course sizes - beware of marketing statistics - (2005-02-27)
[240] Conventional restraints removed - (2005-03-09)
[355] Context in Perl - (2005-06-22)
[463] Splitting the difference - (2005-10-13)
[560] The fencepost problem - (2006-01-10)
[622] Queues and barrel rolls in Perl - (2006-02-24)
[762] Huge data files - what happened earlier? - (2006-06-15)
[773] Breaking bread - (2006-06-22)
[928] C++ and Perl - why did they do it THAT way? - (2006-11-16)
[968] Perl - a list or a hash? - (2006-12-06)
[1304] Last elements in a Perl or Python list - (2007-08-16)
[1316] Filtering and altering Perl lists with grep and map - (2007-08-23)
[1703] Perl ... adding to a list - end, middle, start - (2008-07-09)
[1828] Perl - map to process every member of a list (array) - (2008-10-09)
[1917] Out of memory during array extend - Perl - (2008-12-02)
[1918] Perl Socket Programming Examples - (2008-12-02)
[2067] Perl - lists do so much more than arrays - (2009-03-05)
[2226] Revision / Summary of lists - Perl - (2009-06-10)
[2484] Finding text and what surrounds it - contextual grep - (2009-10-30)
[2813] Iterating over a Perl list and changing all items - (2010-06-15)
[2833] Fresh Perl Teaching Examples - part 2 of 3 - (2010-06-27)
[3400] $ is atomic and % and @ are molecular - Perl - (2011-08-20)
[3548] Dark mornings, dog update, and Python and Lua courses before Christmas - (2011-12-10)
[3669] Stepping through a list (or an array) in reverse order - (2012-03-23)
[3870] Writing more maintainable Perl - naming fields from your data records - (2012-09-25)
[3939] Lots of ways of doing the same thing in Perl - list iteration - (2012-12-03)
[4609] Mapping an array / list without a loop - how to do it in Perl 6 - (2016-01-03)
Some other Articles
Identifying your real customers and keeping them well informed fastEvery Customer CountsWeather picturesTaking the lead, not the dog, for a walk.How should we choose our Wiltshire Police and Crime Commissioner?Want to help us improve transport in Wiltshire? Here is how!Python Programming class for delegates who have already self-taught the basicsShell - Grep - Sed - Awk - Perl - Python - which to use when?How much parking should there be at Melksham Campus?