| 1 | #!/usr/bin/perl | ||
| 2 | |||
| 3 | 2 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 2 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 2 | ▶ | use Mason::App; |
|
Subroutine
BEGIN: called CC=1 SCAR=2.6
| |||
| 6 | Mason::App->run(); | ||
| 7 | |||
| 8 | __END__ | ||
| 9 | |||
| 10 | =pod | ||
| 11 | |||
| 12 | =head1 NAME | ||
| 13 | |||
| 14 | mason.pl - evaluate a mason template and output the result | ||
| 15 | |||
| 16 | =head1 SYNOPSIS | ||
| 17 | |||
| 18 | # Evaluate template from STDIN | ||
| 19 | mason.pl [mason options] [--args json-string] | ||
| 20 | |||
| 21 | # Evaluate template in string | ||
| 22 | mason.pl [mason options] [--args json-string] -e "string" | ||
| 23 | |||
| 24 | # Evaluate template in file | ||
| 25 | mason.pl [mason options] [--args json-string] template-file | ||
| 26 | |||
| 27 | =head1 DESCRIPTION | ||
| 28 | |||
| 29 | Reads a Mason template (component) from STDIN, a string, or a file. Runs the | ||
| 30 | template and outputs the result to STDOUT. | ||
| 31 | |||
| 32 | =head1 MASON OPTIONS | ||
| 33 | |||
| 34 | The following Mason options can be specified on the command line: | ||
| 35 | |||
| 36 | --data-dir /path/to/data_dir | ||
| 37 | --plugins MyPlugin,MyOtherPlugin | ||
| 38 | |||
| 39 | The C<comp_root> will be set to the directory of the template file or to a | ||
| 40 | temporary directory if using STDIN. If not specified C<data_dir> will be set to | ||
| 41 | a temporary directory. | ||
| 42 | |||
| 43 | =head1 ADDITIONAL OPTIONS | ||
| 44 | |||
| 45 | =over | ||
| 46 | |||
| 47 | =item --args json-string | ||
| 48 | |||
| 49 | A hash of arguments to pass to the page component, in JSON form. e.g. | ||
| 50 | |||
| 51 | --args '{"count":5,"names":["Alice","Bob"]}' | ||
| 52 | |||
| 53 | =back | ||
| 54 | |||
| 55 | =head1 SEE ALSO | ||
| 56 | |||
| 57 | L<Mason|Mason> | ||
| 58 | |||
| 59 | =head1 AUTHOR | ||
| 60 | |||
| 61 | Jonathan Swartz <swartz@pobox.com> | ||
| 62 | |||
| 63 | =head1 COPYRIGHT AND LICENSE | ||
| 64 | |||
| 65 | This software is copyright (c) 2011 by Jonathan Swartz. | ||
| 66 | |||
| 67 | This is free software; you can redistribute it and/or modify it under the same | ||
| 68 | terms as the Perl 5 programming language system itself. | ||
| 69 | |||
| 70 | =head1 AUTHOR | ||
| 71 | |||
| 72 | Jonathan Swartz <swartz@pobox.com> | ||
| 73 | |||
| 74 | =head1 COPYRIGHT AND LICENSE | ||
| 75 | |||
| 76 | This software is copyright (c) 2012 by Jonathan Swartz. | ||
| 77 | |||
| 78 | This is free software; you can redistribute it and/or modify it under | ||
| 79 | the same terms as the Perl 5 programming language system itself. | ||
| 80 | |||
| 81 | =cut | ||