> Message du 01/10/08 02:54
> De : "Rob Dixon"
> A : "Perl Beginners"
> Copie à : "Mr. Shawn H. Corey"
> Objet : Re: Passing "class" objects to a function
>
>
> Mr. Shawn H. Corey wrote:
> > On Tue, 2008-09-30 at 22:55 +0200, Paul Johnson wrote:
> >>>
> >>> Inside a sub, shift without a parameter will shift @_.  Outside a sub,
> >>> it will shift @ARGV.  Since it does two different things in different
> >>> context, always give it a parameter.  Things that do different things
> >>> should look different.
> >>
> >> No.
> >>
> >> Or, more charitably, your first two sentences are (mostly) correct but I
> >> think you might find yourself fighting a losing battle with the last
> >> two, both philosophically and with your specific suggestion.
> >
> > "Real Perl Programmers prefer things to be visually distinct."
> >   Larry Wall
> >
> > I wasn't the first to have the idea.
>
> I can't find anywhere where that is quoted in context. Considering the amount 
> of
> effort that has gone into making Perl do what is meant when the code is
> ambiguous I very much doubt if he meant what you mean. If he had thought it 
> was
> a bad idea to call shift with an implicit parameter then I don't think he 
> would
> have designed the language so that you could.
>


Agree.
For an experienced *Perl* programmer, using shift rather than shift @_ is more 
comfortable and natural.



Regards,
Jeff.

 Créez votre adresse électronique [EMAIL PROTECTED] 
 1 Go d'espace de stockage, anti-spam et anti-virus intégrés.

Reply via email to