On Wed, 20 Nov 2002 13:34:40 -0000 "Pense, Joachim" <[EMAIL PROTECTED]> wrote:
> Bart Lateur [mailto:[EMAIL PROTECTED]] wrote: > (Mittwoch, 20. November 2002 11:43) > > >On Wed, 20 Nov 2002 04:10:02 -0600, Steven Lembark wrote: > > > >>sub commify > >>{ > >> my ( $max, $sep, $end ) = ( shift, shift, shift ); > > ... > >>} > > > >Wow! Hold it! Am I the only one who finds this absurd? More than one > >shift on the same array in one single expressing, sounds like bad style > >to me. Comments? > > In one of my programs, this would be > > sub commify { > my $max = shift; > my $sep = shift; > my $end = shift; > > ... > } I use this form too. it is more explicit and gives nice way to comment: sub commify { my $max = shift; # this is arg 1 blah my $sep = shift; # arg two blah my $end = shift; # arg III, actually takes hash reference to useless data :) ... } which is better than my ( $max, # ala $sep, # bala $end ) # nica = @_; imo. it is matter of taste of cource... my ( ... ) = @_; has the only advantage to be ~20% faster for large number of function call iterations. finally: sub nonsensessez { my $s = $_[0]; my $a = $_[1]; my $k = $_[2]; my $j = $_[3]; my $l = $_[4]; 1; } combines the best from both forms above ( i.e. cna be commented, clean and approx. as fast as `my ( ... ) = @_' thing. P! Vladi. > > better or even worse in your view? > > Joachim > -- Vladi Belperchinov-Shabanski <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> Personal home page at http://www.biscom.net/~cade DataMax Ltd. http://www.datamax.bg Too many hopes and dreams won't see the light...
msg02736/pgp00000.pgp
Description: PGP signature