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