Catmandu::Fix::add_to_exporter(3pm)

Catmandu::Fix::add_to_exporter3pm

Export a record as side effect

Usage

   # Export the data field values to a CSV file
   add_to_exporter(data,CSV, file:/tmp/test.txt, header: 1)
   # Export the complete record into a JSON file
   add_to_exporter(data,JSON, file:/tmp/test.json, pretty:1)
   # In general, export a PATH to an EXPORTER with one ore more OPT0s
   add_to_exporter(PATH,EXPORTER, OPT1:... , OPT2:... , OPT3:... , ...)
   # Use the add_to_exporter to explode an ARRAY into many records
   # E.g.
   #   books:
   #     - title: Graphic Design Rules
   #       year: 2003
   #     - title: Urban Sketching
   #       year: 2013
   #     - title: Findus flyttar ut
   #       year: 2012
   # And a fix file: exporter.fix
   do with(path => books)
      add_to_exporter(.,JSON)
   end
   # You can get an output with 3 records using the command line function
   catmandu convert JSON to Null --fix exporter.fix < book.json

Releases

5 releases since Debian 9 (Stretch); the text changed 4 times.

  1. 9
  2. 10
  3. 11
  4. 12
  5. 13

From libcatmandu-perl 1.2024-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.