Hi,

On Fri, 09 Dec 2011 20:44:18 +0000
Rob Dixon <rob.di...@gmx.com> wrote:

> On 09/12/2011 11:35, flebber wrote:
> With this program
> 
>    @data = <ARGV>;
>    $sum += $_ for @data;
>    print $sum / @data;
> 

This program:

1. Does not have "use strict;" and "use warnings;".

2. Collects all lines in one giant array (which is a waste of memory.).

3. Does not do exactly match the original program.

It can and should be written better.

All that put aside, I think it's possible that giving full programs as
answers to people's questions here may be detrimental to the process of
helping them, because they will just use that program, instead of learning
how to properly write the code themselves.

Regards,

        Shlomi Fish  

-- 
-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
List of Portability Libraries - http://shlom.in/port-libs

You can never truly appreciate The Gilmore Girls until you’ve watched it in
the original Klingon.

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

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to