Catmandu::Exporter::Mock(3pm)

Catmandu::Exporter::Mock3pm

A exporter that doesn't export anything

Usage

    # From the commandline
    $ catmandu convert JSON --fix myfixes to Mock < /tmp/data.json
    # From Perl
    use Catmandu;
    # Print to STDOUT
    my $exporter = Catmandu->exporter('Mock',fix => 'myfix.txt');
    $exporter->add_many($arrayref);
    $exporter->add_many($iterator);
    $exporter->add_many(sub { });
    $exporter->add($hashref);
    printf "exported %d items\n" , $exporter->count;
    # Get an array ref of all records exported
    my $data = $exporter->as_arrayref;

Overview

This exporter exports nothing and can be used as in situations where you e.g. export data from a fix. Other the Null exporter, the Mock exporter will keep an internal array of all the records exported which can be retrieved with the 'as_arrayref' method.

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.