Oh, and I nearly forgot the ob. version using an XML-based language, interpreted of course using XML::Twig:
#!/usr/bin/perl -w use strict; use XML::Twig; eval script2perl( XML::Twig->new->parse( \*DATA)); sub script2perl { my $t= shift; foreach my $for ($t->findnodes( '//for')) { if( my $range= $for->att( 'range')) { $for->prefix( "for ($range) {\n") ->suffix( "\n}\n") ->erase; } } foreach my $print ($t->findnodes( '//print')) { $print->prefix( q{ print "}) ->suffix( q{";}) ->erase; } return $t->root->text } __DATA__ <script> <for range="1..500"> <print>I will not throw paper airplanes in class.\n</print> </for> </script>
In reply to Re: (TIMTOWTDI / Golf / Obfu) Airplanes in class
by mirod
in thread (TIMTOWTDI / Golf / Obfu) Airplanes in class
by Juerd
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |