in reply to Regex failure interpretation

I'll take a shot. What this does is capture a single character to $1, again and again. The last capture is the one you see in $1. So the regexp is actually capturing the last element of your binary string.

To capture the first element, try $_ =~ m/^([01])[01]*$/ and print "$_:'$1'\n" for qw[ 0 1 00 11 10 01 012];

-Mark