Hi Shawn, Thanks for your message.
Thanks for trimming my message so carefully and not replying to all my points. (That was sarcasm.) On Monday 12 Apr 2010 17:50:14 Shawn H Corey wrote: > Shlomi Fish wrote: > > Because people often don't know for sure what is the right way, and > > confuse it. On the other hand, people don't normally think that "shift;" > > How do you know what people think? You're assuming because it's easy > for you, it will be easy for everyone. Well, I've explained why I believe most people think so in my message. Naturally, generalising based on a few data points is something that needs to be done carefully. If we drop a 100 objects and they all fall down, then nothing in pure logic or pure mathematics guarantees that the 101st object will fall down (see http://en.wikipedia.org/wiki/Inductive_reasoning ). But we must make such generalisations in order to survive. I've seen << my $param = shift; >> used instead of << shift(@_); >> or << shift @_; >> in many places in production code on CPAN and elsewhere. I haven't seen or received any patches requesting to change these to the more explicit form with the @_. Furthermore, a lot of code I write is buried deep inside the functions and methods of modules where doing << shift(@_);>> would be clutter because in the vast majority of cases a module does not handle @ARGV directly. Which arguments do you give in favour of using << shift(@_); >> instead of << shift; >>? The fact that << shift; >> extracts out of @_ or @ARGV by default is documented in "perldoc -f shift;" http://perldoc.perl.org/functions/shift.html and, like I noted, the programmer knows which is the case by reading the code and by the indentation. This is probably more than I should have written given the length of your answer, but I guess I respect you enough in order to have written it. The way I see it if you're going to say that one should use "my $param = sh...@_;>> instead of <<my $param = shift;>>, it will just add more noise to the list, and I will give another braindump of why I think that way. I apologise for the tone of this E-mail. Regards, Shlomi Fish -- ----------------------------------------------------------------- Shlomi Fish http://www.shlomifish.org/ "Star Trek: We, the Living Dead" - http://shlom.in/st-wtld Deletionists delete Wikipedia articles that they consider lame. Chuck Norris deletes deletionists whom he considers lame. 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/