<%args> $name => undef $SETS => undef <%init> return unless ref $SETS; return unless $name; my $schedule = []; foreach my $key (keys %$SETS) { if ($key =~ /^${name}_(name|alias|image|amage|url|delete)_(\d+)$/) { my $field = $1; my $i = $2; $schedule->[$i-1]->{$field} = $SETS->{$key} if $SETS->{$key}; } } @$schedule = grep { !$_->{delete} } @$schedule; local $Data::Dumper::Indent = 0; return Data::Dumper::Dumper($schedule);