my $self = shift;
# remove it from the active message list
- @msg = map { $_ != $self ? $_ : () } @msg;
+ @msg = grep { $ref($_) && $_ != $self } @msg;
# belt and braces (one day I will ask someone if this is REALLY necessary)
delete $self->{gotit};
# mark old messages for deletion
foreach $ref (@msg) {
- if (!$ref->{keep} && $ref->{t} < $main::systime - $maxage) {
+ if (ref($ref) && !$ref->{keep} && $ref->{t} < $main::systime - $maxage) {
$ref->{deleteme} = 1;
delete $ref->{gotit};
delete $ref->{list};
}
# remove them all from the active message list
- @msg = map { $_->{deleteme} ? () : $_ } @msg;
+ @msg = grep { ref($_) && !$_->{deleteme} } @msg;
$last_clean = $main::systime;
}