How can I split a string into only two parts with Perl?

Viewed 40401

I have a string that with several parts separated by tabs:

 Hello\t2009-08-08\t1\t2009-08-09\t5\t2009-08-11\t15

I want to split it up only on the first tab, so that "Hello" ends up in $k and and rest ends up in $v. This doesn't quite work:

my ($k, $v) = split(/\t/, $string);

How can I do that?

3 Answers
Related