$string = "a:b:c"; ($line) = split /:/, $string, 0; print "Split zero times - $line\n"; ($line) = split /:/, $string, 1; print "Split one time - $line\n"; ($line) = split /:/, $string, 2; print "Split two times - $line\n"; outputs: Split zero times - a Split one time - a:b:c Split two times - a