#$Storable::forgive_me = 1;
%EXPORT_TAGS = (
- common => [qw(interval_to_seconds seconds_to_interval sendmail)],
+ common => [qw(interval_to_seconds seconds_to_interval sendmail tree_filter)],
daemon => [qw(safe_fork set_psname daemonize)],
datetime => [qw(clense_ISO8601 gmtime_ISO8601 interval_to_seconds seconds_to_interval)],
);
}
}
+sub tree_filter {
+ my $tree = shift;
+ my $field = shift;
+ my $filter = shift;
+
+ my @things = $filter->($tree);
+ for my $v ( @{$tree->$field} ){
+ push @things, $filter->($v);
+ push @things, tree_filter($v, $field, $filter);
+ }
+ return @things
+}
+
#sub standalone_ipc_cache {
# my $self = shift;
# my $class = ref($self) || $self;