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

Jay Hannah jhannah at omnihotels.com
Wed Mar 22 10:09:23 PST 2006


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




More information about the Omaha-pm mailing list