develooper Front page | perl.beginners | Postings from January 2002

Happy New Yr Y2K+2 =) Spliting Question

Thread Next
Connie Chan
January 3, 2002 13:35
Happy New Yr Y2K+2 =) Spliting Question
Message ID:
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 ?

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About