Filter::Macro

Filter::Macro is a Perl module to make macro modules that are expanded inline.
Download

Filter::Macro Ranking & Summary

Advertisement

  • Rating:
  • License:
  • MIT/X Consortium Lic...
  • Price:
  • FREE
  • Publisher Name:
  • Audrey Tang
  • Publisher web site:
  • http://search.cpan.org/~adamk/Module-Install-0.68/lib/Module/Install/PAR.pm

Filter::Macro Tags


Filter::Macro Description

Filter::Macro is a Perl module to make macro modules that are expanded inline. Filter::Macro is a Perl module to make macro modules that are expanded inline.SYNOPSISIn MyHandyModules.pm: package MyHandyModules; use Filter::Macro; # lines below will be expanded into caller's code use strict; use warnings; use Switch; use IO::All; use Quantum::Superpositions;In your program or module: use MyHandyModules; # lines above are expanded hereIf many of your programs begin with the same lines, it may make sense to abstract them away into a module, and use that module instead.Sadly, it does not work that way, because by default, all lexical pragmas, source filters and subroutine imports invoked in MyHandyModules.pm takes effect in that module, not the calling programs.One way to solve this problem is to use Filter::Include: use Filter::Include; include MyHandyModules;However, it would be really nice if MyHandyModules.pm could define the macro-like semantic itself, instead of placing the burden on the caller.This module lets you do precisely that. All you need to do is to put one line in MyHandyModules.pm, after the package MyHandyModules; line: use Filter::Macro;With this, a program or module that says use Filter::Macro will expand lines below use Filter::Macro into their own code, instead of the default semantic of evaluating them in the MyHandyModules package.Line numbers in error and warning messages are unaffected by this module; they still point to the correct file name and line numbers. Requirements: · Perl


Filter::Macro Related Software