#! perl -slw use strict; my @bits = unpack '(a3)*', 'abcdefghijklmnopqrstuvwxyz'; 1 while "@bits[3,5,7]" =~ m[vwx]g;