Un-obfuscated version ;-)
#!/usr/bin/perl -w use strict; use XML::Twig; sub script2perl { my ($t) = @_; for ($t->findnodes('//for')) { my $range = $_->att('range') or next; $_->prefix("for ($range) {\n"); $_->suffix("\n}\n"); $_->erase; } for ($t->findnodes('//print')) { $_->prefix(' print "'); $_->suffix('";'); $_->erase; } return $t->root->text; } eval script2perl XML::Twig->new->parse(\*DATA);
I found your code hard to read. Not only the way you put curlies, but also that whitespace in your parens and around your =s is unbalanced. Is this your usual style or was it really a try to obfuscate?
Please note: I'm not attacking, just very curious.
Update: reading XML::Twig's documentation and source already gave me the answer: this is indeed your usual style. Wow.
Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }
In reply to Re: Re: (TIMTOWTDI / Golf / Obfu) Airplanes in class
by Juerd
in thread (TIMTOWTDI / Golf / Obfu) Airplanes in class
by Juerd
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |