[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Omaha.pm] @_[1..$#_] is that evil? -laugh-



Wow. Is this readable? I think this is the first time in my life I've
intentionally used $#_  (or any $#x for that matter...)

sub set_rate_single  {
$_[0]->SUPER::set_rate_single($_[0]->rate_split_shrinker( @_[1..$#_])) }
sub set_rate_double  {
$_[0]->SUPER::set_rate_double($_[0]->rate_split_shrinker( @_[1..$#_])) }
sub set_rate_xperson {
$_[0]->SUPER::set_rate_xperson($_[0]->rate_split_shrinker(@_[1..$#_])) }

Should I make these each 5 liners instead?

j


The long way would be:

sub set_rate_single  { 
   my ($self, @rates) = @_;
   my $result = $self->rate_split_shrinker(@rates);
   return $self->SUPER::set_rate_single($result);
}
...ditto double
...ditto xperson