for my $char ( unpack '(A1)*', substr $x, 0, 100, '' ) { ## }