The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
/*! \page streaming Streaming a dataset

The code here does not have any warranty. It is recommended that
before using any of this code, you look into it and try to understand
what it does, what input it needs, etc. Do not blindly execute
anything!

This example will stream a vector dataset as GML through an object,
which implements <a
href="http://search.cpan.org/~miyagawa/PSGI-1.102/PSGI.pod#Delayed_Response_and_Streaming_Body">write
and close methods</a>.

\code

my $layer = Geo::OGR::DataSource::Open(<data source name here>)->GetLayer(<layer name here>);

{
    package Writer;
    sub write {
        # note that the object itself is not available!
        my ($w) = @_;
        print $w;
    }
    sub close {
        # note that the object itself is not available!
        print "done\n";
    }
}

my $writer = bless {}, 'Writer';

Geo::OGR::Driver('GML')->Create($writer)->CopyLayer($layer, <layer name here>);

\endcode

*/