Text::MacroScript

Text::MacroScript is a macro pre-processor with embedded perl capability.
Download

Text::MacroScript Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Mark Summerfield
  • Publisher web site:
  • http://search.cpan.org/~summer/

Text::MacroScript Tags


Text::MacroScript Description

Text::MacroScript is a macro pre-processor with embedded perl capability. Text::MacroScript is a macro pre-processor with embedded perl capability.SYNOPSIS use Text::MacroScript ; # new() for macro processing my $Macro = Text::MacroScript->new ; while( ) { print $Macro->expand( $_ ) if $_ ; } # Canonical use (the filename improves error messages): my $Macro = Text::MacroScript->new ; while( ) { print $Macro->expand( $_, $ARGV ) if $_ ; } # new() for embedded macro processing my $Macro = Text::MacroScript->new( -embedded => 1 ) ; # Delimiters default to # or my $Macro = Text::MacroScript->new( -opendelim => ']' ) ; while( ) { print $Macro->expand_delimited( $_, $ARGV ) if $_ ; } # Create a macro object and create initial macros/scripts from the file(s) # given: my $Macro = Text::MacroScript->new( -file => ) ; # Create a macro object and create initial macros/scripts from the # definition(s) given: my $Macro = Text::MacroScript->new( -macro => , ], -script => , ], -variable => , ) ; # We may of course use any combination of the options. my $Macro = Text::MacroScript->new( -comment => 1 ) ; # Create the %%[] macro. # define() $Macro->define( -macro, $macroname, $macrobody ) ; $Macro->define( -script, $scriptname, $scriptbody ) ; $Macro->define( -variable, $variablename, $variablebody ) ; # undefine() $Macro->undefine( -macro, $macroname ) ; $Macro->undefine( -script, $scriptname ) ; $Macro->undefine( -variable, $variablename ) ; # undefine_all() $Macro->undefine( -macro ) ; $Macro->undefine( -script ) ; $Macro->undefine( -variable ) ; # list() @macros = $Macro->list( -macro ) ; @macros = $Macro->list( -macro, -namesonly ) ; @scripts = $Macro->list( -script ) ; @scripts = $Macro->list( -script, -namesonly ) ; @variables = $Macro->list( -variable ) ; @variables = $Macro->list( -variable, -namesonly ) ; # load_file() - always treats the contents as within delimiters if we are # doing embedded processing. $Macro->load_file( $filename ) ; # expand_file() - calls expand_embedded() if we are doing embedded # processing otherwise calls expand(). $Macro->expand_file( $filename ) ; @expanded = $Macro->expand_file( $filename ) ; # expand() $expanded = $Macro->expand( $unexpanded ) ; $expanded = $Macro->expand( $unexpanded, $filename ) ; # expand_embedded() $expanded = $Macro->expand_embedded( $unexpanded ) ; $expanded = $Macro->expand_embedded( $unexpanded, $filename ) ;This bundle also includes the macro and macrodir scripts which allows us to expand macros without having to use/understand Text::MacroScript.pm, although you will have to learn the handful of macro commands available and which are documented here and in macro. macro provides more documentation on the embedded approach.The macroutil.pl library supplied provides some functions which you may choose to use in HTML work for example.Requirements:· Perl Requirements: · Perl


Text::MacroScript Related Software