# give stdin a:b or hello:world or etc:etc while (){ ($a,$b) = split(/:/,$_,2); print "$a$b\n"; } #### (split(/:/)[0..1]? (split(/:/)[0,1]?