26 Nov 2016 18:07:32 UTC
- Distribution: Language-l33t
- Module version: v1.0.1
- Source (raw)
- Browse (raw)
- How to Contribute
- Testers (246 / 0 / 105)
- KwaliteeBus factor: 1
- 75.00% Coverage
- License: perl_5
- Perl: v5.20.0
- Download (24.19KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version
- SEE ALSO
- COPYRIGHT AND LICENSE
Language::l33t - a l33t interpreter
use Language::l33t; my $interpreter = Language::l33t->new; $interpreter->set_source( '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 Language::l33t::Specifications.
Creates a new interpreter. The options that can be passed to the function are:
- debug => $flag
If $flag is set to true, the interpreter will print debugging information as it does its thing.
- stdin => $io
Ties the stdin of the interpreter to the given object.
- stdout => $io
Ties the stdout of the interpreter to the given object.
my $output; open my $fh_output, '>', \$output; my $l33t = Language::l33t->new( stdout => $fh_output ); $l33t->set_source( $code ); $l33t->run; print "l33t output: $output";
- memory_max_size => $bytes
The size of the block of memory available to interpreter. By default set to 64K (as the specs recomment).
- byte_size => $size
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.
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.
Reset the interpreter to its initial setting. Code is recompiled, and pointers reset to their initial values.
my $l33t = Language::l33t->new(); $l33t->load( $code ); $l33t->run; # to run the same code a second time $l33t->reset; $l33t->run;
Returns the memory of the interpreter in its current state as an array.
- F00l! teh c0d3 1s b1g3R th4n teh m3m0ry!!1!
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.
- Byt3 s1z3 must be at l34st 11, n00b!
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).
- L0L!!1!1!! n0 l33t pr0gr4m l04d3d, sUxX0r!
run() called before any program was load()ed.
It goes without saying, special thanks go to Stephen McGreal and Alex Mole for inventing l33t. They are teh rOxX0rs.
Yanick Champoux <email@example.com>
This software is copyright (c) 2006 by Yanick Champoux.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Module Install Instructions
To install Language::l33t, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install Language::l33t
For more information on module installation, please visit the detailed CPAN module installation guide.
|s||Focus search bar|
|?||Bring up this help dialog|
|g p||Go to pull requests|
|g i||go to github issues (only if github is preferred repository)|
|g a||Go to author|
|g c||Go to changes|
|g i||Go to issues|
|g d||Go to dist|
|g r||Go to repository/SCM|
|g s||Go to source|
|g b||Go to file browse|