I think that I didn't opposed myself to the pattern:

sub xpto {
    my $var1 = shift;
    my $var2 = shift;
    ...
}

Where it is clear that you wont to assign the parameters. 90% of the
times I prefer to have pattern

sub xpto {
    my ($var1, $var2) = @_;
    ...
}

since, in my opinion, makes the intentions more clear.


Now setting shift inside logic, I clearly say: please add the @_ and
make clear that you know the array that you are using, make clear your
intentions.

Best regards
Marcos Rebelo

On Mon, Jun 28, 2010 at 4:15 PM, Shlomi Fish <shlo...@iglu.org.il> wrote:
> Hi Shawn,
>
> On Sunday 27 Jun 2010 20:41:31 Shawn H Corey wrote:
>> On 10-06-27 01:08 PM, marcos rebelo wrote:
>> > Hi all
>> >
>> > This time, it's much more a personal opinion than a recipe.
>> >
>> > http://sites.google.com/site/oleberperlrecipes/recipes/01-variables/04---
>> > misc/01-when-shall-we-use-default-variables
>> >
>> > Opinions are always welcome in perl-reci...@googlegroups.com
>> >
>> > Best Regards
>> > Marcos Rebelo
>>
>> An opinion I have held all along:  Things that behave differently should
>> look different.  That means *always* put the array in the shift.
>
> You seem to have an obsession with getting people to stop using "my $param =
> shift;" and use "my $param = shift(@_);" instead. This is depsite the fact
> that a lot of high-quality, production code on CPAN and elsewhere is using it
> extensively. We already had at least two full length discussions here about it
> and you're still going.
>
> Please see what chromatic and I wrote about it here:
>
> * http://community.livejournal.com/shlomif_tech/35842.html
>
> Namely, we said that there are many fine points of style that even experienced
> developers disagree upon, and the best way is to avoid opening this Pandora
> box in the first place. If someone doesn't do something exactly the way you
> are used to, but it's still idiomatic, then the best idea would be to let it
> go.
>
> Regards,
>
>        Shlomi Fish
>
> --
> -----------------------------------------------------------------
> Shlomi Fish       http://www.shlomifish.org/
> Stop Using MSIE - http://www.shlomifish.org/no-ie/
>
> God considered inflicting XSLT as the tenth plague of Egypt, but then
> decided against it because he thought it would be too evil.
>
> 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/
>
>
>



-- 
Marcos Rebelo
http://oleber.freehostia.com
Milan Perl Mongers leader http://milan.pm.org
Webmaster of http://sites.google.com/site/oleberperlrecipes/

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