my @array = split m/(.{8})/, $string; @array = grep length, @array #### push @array, $1 while $str =~ m/(.{1,8})/g;