« blib/lib/XML/Grammar/Screenplay/FromProto.pm
↑ Summary
blib/lib/XML/Grammar/FictionBase/Event.pm »
| 1 | package XML::Grammar::Fiction::App::FromProto; | ||||||||||
| 2 | 1 | $XML::Grammar::Fiction::App::FromProto::VERSION = '0.32.0'; | |||||||||
| 3 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 1 | ▶ | use autodie; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 1 | ▶ | use parent 'Exporter'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | 1 | our @EXPORT = (qw(run)); | |||||||||
| 10 | |||||||||||
| 11 | 1 | ▶ | use Getopt::Long qw/ GetOptions /; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | |||||||||||
| 13 | |||||||||||
| 14 | sub run | ||||||||||
| 15 | 0 | ▶ | { | ||||||||
|
Subroutine
run: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 16 | 0 | my $output_filename; | |||||||||
| 17 | |||||||||||
| 18 | 0 | GetOptions( "output|o=s" => \$output_filename, ); | |||||||||
| 19 | |||||||||||
| 20 | 0 | ▶ | if ( !defined($output_filename) ) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 21 | { | ||||||||||
| 22 | 0 | die "Output filename not specified! Use the -o|--output flag!"; | |||||||||
| 23 | } | ||||||||||
| 24 | |||||||||||
| 25 | 0 | require XML::Grammar::Fiction::FromProto; | |||||||||
| 26 | 0 | require XML::Grammar::Fiction::FromProto::Parser::QnD; | |||||||||
| 27 | 0 | my $converter = XML::Grammar::Fiction::FromProto->new( | |||||||||
| 28 | { | ||||||||||
| 29 | parser_class => "XML::Grammar::Fiction::FromProto::Parser::QnD", | ||||||||||
| 30 | } | ||||||||||
| 31 | ); | ||||||||||
| 32 | |||||||||||
| 33 | 0 | $converter->_convert_while_handling_errors( | |||||||||
| 34 | { | ||||||||||
| 35 | convert_args => { | ||||||||||
| 36 | source => { file => shift(@ARGV), }, | ||||||||||
| 37 | }, | ||||||||||
| 38 | output_filename => $output_filename, | ||||||||||
| 39 | } | ||||||||||
| 40 | ); | ||||||||||
| 41 | |||||||||||
| 42 | 0 | exit(0); | |||||||||
| 43 | } | ||||||||||
| 44 | |||||||||||
| 45 | 1 | 1; | |||||||||
| 46 | |||||||||||
| 47 | __END__ | ||||||||||