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

Happy New Yr Y2K+2 =) Spliting Question

Thread Next
From:
Connie Chan
Date:
January 3, 2002 13:35
Subject:
Happy New Yr Y2K+2 =) Spliting Question
Message ID:
003f01c1949d$04a9d5a0$9918fea9@omega
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


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About