I am working on a module and set of tools for injecting source into
another file at compile time.  It currently does this by using
Filter::Util::Call to hook into the compilation process, inject the
new code before the next line that perl will compile, and then remove
itself handing control back to the compiler.

I have tentatively named this module `eval.pm`

    use eval 'my $x = 1';

    use eval some_sub(...);

since `use` implies compile time and it is injecting the source into
the currently compiling `eval`.

but I am considering any of the following names:

    eval
    insert
    inject
    inline
    compile
    here

Since all of these names are single word/lowercase names, I wanted to
put the name up for the Perl community to comment on.

I have a fully written module with a decent test suite ready to upload
once the name is finalized.

The overall goal of the module is to allow people to write a macro function:

    sub my_0 {map "my \$$_ = 0", @_}

And then be able to write:

     use eval my_0 qw(x y z);

And have the compiler see `my $x = 0; my $y = 0; my $z = 0;`

Thanks for your time,

Eric Strom
a...@cpan.org
https://metacpan.org/author/ASG

Reply via email to