sub case_new { my $matched = 0; return sub { my $check = shift; return $matched ||= (ref $check eq 'Regexp' and /$check/) || $_ eq $check; } }