in reply to What's the best metaphor for deleting something from a list?
Which is really just evaluating a match/mismatch case, but with some intermediate code to increment $scrubbed.sub delete_field { my $self = shift; my ($deleter) = @_; my $scrubbed = 0; @{$self->{_fields}} = grep { !(($deleter eq $_) && ++$scrubbed) } @{$self->{_fields}}; return $scrubbed; }
|
|---|