foreach (keys %data) { next if $_ =~ m/^aaa$/ || $_ =~ m/^\[/ || $_ =~ m/\// || $_ =~ m/and/; print "$_\n"; }