use Text::ParseWords; $str = "a b c"; @f = split /\t/, $str; print scalar @f, "\n"; @f = parse_line('\t', 0, $str); print scalar @f, "\n"; #### [root@localhost root]# perl temp.pl 4 4