say, $a = "1234:4321;abcde;fghij::;klmno"; In case, I want $x = "1234" , $y = "4321", $data = "abcde;fghij::;klmno" Then I do in this way :
@dataLine = split(/;/, $a); ($x, $y) = split (/:/, $dataLine[0]); $data = join(";", shift(@dataLine)); So I can get the result what I want... but, anybody can suggest me if this process can be done simplier ?