in reply to Very very small style question
orsub method { my ($self, $i, $new) = @_; my $old = $self->{B}[$i]; #make sure we have correct number of parameters $self->{B}[$i] = $new if @_ > 2; return $old; }
Couldn't you do an (if defined $new) also?sub method { my ($self, $i, $new) = @_; my $old = $self->{B}[$i]; #make sure we have correct number of parameters $self->{B}[$i] = $new if @_ >= 3; return $old; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Very very small style question
by chipmunk (Parson) on Dec 18, 2000 at 07:15 UTC | |
|
Re: Very very small style question
by Dominus (Parson) on Dec 18, 2000 at 09:20 UTC |