Acme::Perl::VM

A Perl5 Virtual Machine in Pure Perl (APVM)
Download

Acme::Perl::VM Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Goro Fuji
  • Publisher web site:
  • http://search.cpan.org/~gfuji/

Acme::Perl::VM Tags


Acme::Perl::VM Description

A Perl5 Virtual Machine in Pure Perl (APVM) Acme::Perl::VM is an implementation of Perl5 virtual machine in pure Perl.Perl provides a feature to access compiled syntax trees (opcodes) by B module. B::* modules walk into opcodes and do various things; B::Deparse retrieves Perl source code from subroutine references, B::Concise reports formatted syntax trees, and so on.Acme::Perl::VM is a Perl module that also walks into the opcodes, and executes them with its own ppcodes.You can run any Perl code: use Acme::Perl::VM; run_block { print "Hello, APVM world!\n"; };This code says Hello, APVM world to stdout as you expect.Here is a more interesting example: BEGIN{ $ENV{APVM} = 'trace' } use Acme::Perl::VM; run_block { print "Hello, APVM world!\n"; };And you'll get a list of opcodes as the code runs: .entersub(&__ANON__) VOID .nextstate(main -:4) VOID .pushmark SCALAR .const("Hello, APVM world!\n") SCALAR .print SCALAR KIDS Hello, APVM world! .leavesub KIDSThe first entersub is the start of the block. The next nextstate indicates the statement that says hello. pushmark, const, and print are opcodes which runs on the statement. The last leavesub is the end of the block. This is a future of the module.SYNOPSIS use Acme::Perl::VM; run_block{ print "Hello, APVM world!\n", }; Requirements: · Perl


Acme::Perl::VM Related Software