On Friday 08 October 2010 15:03:47 Jonas Bull wrote: > Only one thing I'd mention: > > Under "Subroutine Arguments Handling" you offer $var=shift; as a > better alternative to $var=$_[n] - which it is - but it is a > (admittedly slight) performance hit vs ($var,$var2,...)=...@_; >
Well, one good use case for «my $var = shift;» is this: sub my_method { my $self = shift; my ($arg1, $arg2, $arg3 ... ) = @_; . . . return $self->_other_method(@_); } In perl-5.10.0 before perl-5.10.1 came out, there was a significant slowdown in the execution of one of the forms, but I don't remember which one. In any case, both forms are acceptable and make for good practices, and the performance hit is not significant. > > Otherwise, pretty useful info. I'm forwarding the link to the rest of > my group. :-) > Thanks! Regards, Shlomi Fish > Jonas Bull > -- ----------------------------------------------------------------- Shlomi Fish http://www.shlomifish.org/ The Case for File Swapping - http://shlom.in/file-swap <rindolf> She's a hot chick. But she smokes. <go|dfish> She can smoke as long as she's smokin'. 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/