
Lingua::Tolkien::BURL -- An Orkish scripting language.

use Lingua::Tolkien::BURL;
u BURL uses the letter 'u' to denote comments.
u In Orkish, 'u' means 'to, towards', and thus
u probably implies something like 'ad hoc' for
u BURL programmers, further strengthening the
u belief that Orcs make poor code documenters.
magog This is only a test. --
dab bat = shum 'a' o 'b' o 'e' -- skai
uur bat -- mogda nar!
zabruuz gaakh 1 == 1 -- mog "ok" skai sha!
dab myhashul!
myhashuk gimb member! = 5 skai!
mog myhashuk gimb member!!
dab fugat = raakha o "a b c d e" skai
uur fugat --
mog da skai zabruuz! nar!

BURL is based on perl -- in fact, it is a subset of perl, written with the Orc-programmer in mind. As such, control structures use Orkish or Black Speech instead of English; also, the rules of the scripting language are more constrained than perl. In fact, they are constrained to a format which is quite amenable to line-substitution translation into perl, strangely enough.
The most striking feature of BURL (aside from its use of Black Speech, of course) is the lopsided block delimiters nar! and sha!, which only terminate a block. BURL assumes that control structures begin all blocks (horrors!).

Here are the basic rules for BURL:
1. Exclamation points separate statements. So does the keyword 'skai'.
2. The double-dash separates control expressions from control blocks.
3. Blocks end with nar! or sha! (They are interchangeable).
4. û and uu are interchangeable, as are â and aa.
5. Commands may not always require whitespace separation. For example, the Perl snippet foreach (@bat) { print; } Can be written in BURL as: uur daurbat -- mogsha skai!
6. Scalar context is denoted by the suffix 'uk'. Array context is denoted by the suffix 'at'. Hash context is denoted by the suffix 'ul'.
So, this declares a hashtable named "myhash":
dab myhashul!
And this accesses members of myhash:
myhashuk{member};
But there is also special way of indexing hashes:
myhashuk gimb member!
You get the idea. Here is a (mostly) alphabetic index of the elements of BURL:
When found as a suffix, it serves as the array context (@). For example, 'bat' would be translated to '@b'.
When found as a suffix, it serves as the scalar context ($). For example, 'buk' would be translated to '$b'.
When found as a suffix, it serves as the hash context (%). For example, 'bul' would be translated to '%b'.
"mog" works best with single variables. For printing messages, use "magog".

Since the BURL filter relies upon willy-nilly string substitution, there may well be flaws in the current implementation...

Robert Eaglestone

Copyright 2004, Robert Eaglestone
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

The latest version of this library is likely to be available from CPAN.