http://www.perlmonks.org?node_id=1031146


in reply to Re^4: Traversing a complex data structure searching for certain keys and printing their values
in thread Traversing a complex data structure searching for certain keys and printing their values

Just one other thing would you know what I would need to do to this sub routine so that I could get different output formats? For example I still need to pass in @keylist to the subroutine to make sure all the keys are there but I want to also parse in an output format string aswell. So for example if I wanted to print all the lines like this:

%export_name:%filer_device:%filer_volume

or print them with every value like this:

%export_name:%filer_device:%filer_volume:%mount_acl:%mount_group:%moun +t_user:%mount_opts

So I want to be able to pass in $output_format to this function. $output_format equates to one of the strings above. So I could the run funtion like this:

recurse_hash(\%$decoded_json_obj, {}, @keylist, $output_format);
  • Comment on Re^5: Traversing a complex data structure searching for certain keys and printing their values
  • Select or Download Code