The array @[ has one arrayref for each of the characters of "Just Another Perl Hacker". You are generating the character index from the number of sub-arrayrefs and elements counted recursively.#!/usr/bin/perl -w use strict; @[=[ [ [[[[]]], [[]]], [[[]], []], [[]] + ], [ [[[[]]], [[]]], [[[[]]], []], [[[[]]]], [[[]]], [] + ], [ [[[[]]], [[]]], [[[[]]], []], [[[[]]]], [[]], [] + ], [ [[[[]]], [[]]], [[[[]]], []], [[[[]]]], [[[]]] + ], [ [[[[]]], []] + ], [ [[[[]]], [[]]], [] + ], [ [[[[]]], [[]]], [[[[]]], []], [[[]], []], [[[]]], [[]] + ], [ [[[[]]], [[]]], [[[[]]], []], [[[]], []], [[[]]], [[]], [] + ], [ [[[[]]], [[]]], [[[[]]], []], [[[[]]]], [[[]]] + ], [ [[[[]]], [[]]], [[[[]]], []], [[[]], []] + ], [ [[[[]]], [[]]], [[[[]]], []], [[[]]], [] + ], [ [[[[]]], [[]]], [[[[]]], []], [[[[]]]], [[]] + ], [ [[[[]]], []] + ], [ [[[[]]], [[]]], [[[[]]]] + ], [ [[[[]]], [[]]], [[[[]]], []], [[[]]], [] + ], [ [[[[]]], [[]]], [[[[]]], []], [[[[]]]], [[]] + ], [ [[[[]]], [[]]], [[[[]]], []], [[[]], []], [[[]]] + ], [ [[[[]]], []] + ], [ [[[[]]], [[]]], [[[]], []] + ], [ [[[[]]], [[]]], [[[[]]], []], [] + ], [ [[[[]]], [[]]], [[[[]]], []], [[]], [] + ], [ [[[[]]], [[]]], [[[[]]], []], [[[]], []], [[]], [] + ], [ [[[[]]], [[]]], [[[[]]], []], [[[]]], [] + ], [ [[[[]]], [[]]], [[[[]]], []], [[[[]]]], [[]]], [[[[]], []], [[]] + ] ]; sub mysub { my $count = 0; $count += 2**mysub($_) for @{ shift() }; $count; } print chr mysub $_ for @{ @[[$[]}
In reply to Re: Brace For This
by jmcnamara
in thread Brace For This
by MeowChow
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |