my $length = 1000; read (FILEHANDLE, my $varWithChar, $length); my @array = split //, $varWithChar; foreach (@array){ #do stuff with $_ }