On 25/11/2011 12:39, timothy adigun wrote:

==>  John,
TIMTOWTDI =>"There Is More Than One Way To Do It" , I know that! I was
stating/showing option(s). Since, the programmer will take resposiblity for
it own coding styles!

I think John's point is that you were simply rewriting code for the sake
of it, and I agree with him. IMO the original was at least as good as
your changes.

===>  Fish,
«my ($thing1) = @_;» is OK. «my $thing1 = @_;» is not OK, as it will
take scalar(@_); which is the number of elements in it. «my $thing1
 = shift(@_);» (or «my $thing1 = shift;» for short) does something a
 bitdifferent and changes @_.

   Please, check what I wrote, in this example given by Mike, I don't
   see how<<  my $thing1= shift @_;>>  would possible change things here.

Clearly, using shift modifies @_.

I think it is becoming preferred practice to use

my ($pa, $p2, $p3, ...) = @_;

for this very reason.

for clarity use: for (@{$thing1}){...}
   It's certainly clearer than @$thing1, yes equivalent!

I disagree. Removing the braces make the code slightly more compact and
clean, and @$thing1 is unambiguous.

You shouldn't call a scalar "$array" because it's confusing. It could
be "$array_ref". And defining a @array and taking a reference to it
 is a valid strategy.

I never said "defining a @array and taking a reference to it" is NOT a
valid strategy.

So if your modifications aren't 'corrections' then, as I said, you
rewrote code just for the sake of it.

The first two links are to pirated copies of O'Reilly books.

What is your point?

Shlomi's point is presumably that it is inappropriate to encourage
piracy on this list.

Rob

--
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