> Message du 01/10/08 13:08
> De : "Mr. Shawn H. Corey"
> A : "Jeff Pang"
> Copie à : "Rob Dixon" , "Perl Beginners"
> Objet : Re: Passing "class" objects to a function
>
>
> On Wed, 2008-10-01 at 05:04 +0200, Jeff Pang wrote:
> > For an experienced *Perl* programmer, using shift rather than shift @_
> > is more comfortable and natural.
>
> You have just proven my point. You have overlooked the fact the outside
> a sub, shift without a parameter will shift @ARGV, not @_. Even
> experienced programmers need to be reminded of this. That's why it's so
> dangerous. Even experience programmers can read it wrong.
>
Well Shawn, I always wrote:
#!/usr/bin/perl
my $arg1 = shift;
my $arg2 = shift;
....
or,
sub mysub {
my $arg = shift;
....
}
do these two have any drawback?
Regards,
Jeff.
Créez votre adresse électronique [EMAIL PROTECTED]
1 Go d'espace de stockage, anti-spam et anti-virus intégrés.