while (!$io->eof) { $cols = $csvin->getline($io); ... $str = $col[0]; print substr($str,0,3), "\n"; # XXX cuts through utf8 multibyte! }