Help for this page
$v = $_ for 1, 2, 3;
$ perl -wle 'm[^(?{undef $var})(?:([01])(?{$var //= $^N}))+$] and print "$_: '"'"'$var'"'"'" for qw[ 0 1 00 11 10 01 012]' ... 11: '1' 10: '1' 01: '0'