Skip to content

Instantly share code, notes, and snippets.

@ranguard
Last active August 29, 2015 14:00
Show Gist options
  • Select an option

  • Save ranguard/11370900 to your computer and use it in GitHub Desktop.

Select an option

Save ranguard/11370900 to your computer and use it in GitHub Desktop.
How to clean a structure?
my $unclean_data = {
field_1 => 'value',
field_2 => 'value',
do_NOT_leak => 'private info',
wibble => [
{
other_private_info => 'private info',
field_3 => 'value',
field_4 => 'value',
},
{
other_private_info => 'private info',
field_3 => 'value',
field_4 => 'value',
},
],
}
my $ok_structure => {
field_1 => 1,
field_2 => 1,
wibble => [
{
field_3 => 1,
field_4 => 1,
}
],
}
my $clean_data = CleanData->run($unclean_data, $bos_data);
So $clean_data is then:
{
field_1 => 'value',
field_2 => 'value',
wibble => [
{
field_3 => 'value',
field_4 => 'value',
},
{
field_3 => 'value',
field_4 => 'value',
},
],
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment