Language::l33t - a l33t interpreter
use Language::l33t; my $interpreter = Language::l33t->new; $interpreter->load( 'Ph34r my l33t sk1llz' ); $interpreter->run;
Language::l33t is a Perl interpreter of the l33t language created by Stephen McGreal and Alex Mole. For the specifications of l33t, refer to the REFERENCE section.
Creates a new interpreter. The options that can be passed to the function are:
If $flag is set to true, the interpreter will print debugging information as it does its thing.
Ties the stdin/stdout of the interpreter to the given object.
E.g.:
my $output; open my $fh_output, '>', \$output; my $l33t = Language::l33t->new({ stdout => $fh_output }); $l33t->load( $code ); $l33t->run; print "l33t output: $output";
The size of the block of memory used by the interpreter. By default set to 64K (as the specs recomment).
The size of a byte in the memory used by the interpreter. Defaults to 256 (so a memory byte can hold a value going from 0 to 255).
Loads and "compiles" the string $l33tcode. If one program was already loaded, it is clobbered by the newcomer. Returns 1 upon success, 0 if the loading failed.
Runs the loaded program. If $nbr_iterations is given, interupts the program after this number of iterations even if it hasn't terminated. Returns 0 in case the program terminated by evaluating an END, 1 if it finished by reaching $nbr_iterations.
Initializes, or reinitializes the interpreter to its initial setting. Code is recompiled, and pointers reset to their initial values. Implicitly called when new code is load()ed.
Returns 1 upon success, 0 if something went wrong.
E.g.
my $l33t = Language::l33t->new(); $l33t->load( $code ); $l33t->run; # to run the same code a second time $l33t->initialize; $l33t->run;
Returns the memory of the interpreter in its current state as an array.
You tried to load a program that is too big to fit in the memory. Note that at compile time, one byte is reserved for the memory buffer, so the program's size must be less than the memory size minus one byte.
The byte_size argument of new() was less than 11. The byte size of an interpreter must be at least 11 (to accomodate for the opcodes).
run() called before any program was load()ed.
Please report any bugs or feature requests to bug-acme-l33t at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Language::l33t. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-acme-l33t at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Language::l33t
You can also look for information at:
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Language::l33t
CPAN Ratings
http://cpanratings.perl.org/d/Language::l33t
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Language::l33t
Search CPAN
http://search.cpan.org/dist/Language::l33t
Stephen McGreal's l33t page: http://electrod.ifreepages.com/l33t.htm
Wikipedia article on l33t: http://en.wikipedia.org/wiki/L33t_programming_language
Yanick Champoux, <yanick at cpan.org>
<yanick at cpan.org>
It goes without saying, special thanks go to Stephen McGreal and Alex Mole for inventing l33t. They are teh rOxX0rs.
Copyright 2006 Yanick Champoux, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Language::l33t, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Language::l33t
CPAN shell
perl -MCPAN -e shell install Language::l33t
For more information on module installation, please visit the detailed CPAN module installation guide.