stag-handle - streams a stag file through a handler into a writer
stag-handle -w itext -c my-handler.pl myfile.xml > processed.itext stag-handle -w itext -p My::Parser -m My::Handler myfile.xml > processed.itext
will take a Stag compatible format (xml, sxpr or itext), turn the data into an event stream passing it through my-handler.pl
shows this document
A module that is used to transform the input events the module should inherit from Data::Stag::BaseHandler
(you should always use this option if you specify -m)
this is the unit that gets passed to the handler/transformer. this will get set automatically if you use the the -c, -s or -t options
multiple units can be set
-u foo -u bar -u boz
writer for final transformed tree; can be xml, sxpr or itext
perl modules for handling events
a file containing a perlhashref containing event handlers - see below
a perl hashref containing handlers
unix> cat my-handler.pl { person => sub { my ($self, $person) = @_; $person->set_fullname($person->get_firstname . ' ' . $person->get_lastname); $person; }, address => sub { my ($self, $address) = @_; # remove addresses altogether from processed file return; }, }
1 POD Error
The following errors were encountered while parsing the POD:
=over should be: '=over' or '=over positive_number'
To install Data::Stag, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Stag
CPAN shell
perl -MCPAN -e shell install Data::Stag
For more information on module installation, please visit the detailed CPAN module installation guide.