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

Assigning chunks into variables

From:
Ho, Tony
Date:
March 21, 2002 13:52
Subject:
Assigning chunks into variables
Message ID:
17BB19F31428D411B3CC0090279A312802C98781@lon-exch2.kenan.com
Hi guys
I was wondering if you could help me.
 
I have the following string:
 
2010:abc:def:ghi
 
If I go through this string and find the first colon (:), I want to assign
everything before that colon into variable1
I would like to assign the rest of the string after the first colon into
variable2.
 
Therefore,
variable1 = 2010
variable2 = abc:def:ghi
 
I was wondering how I can approach this ?
 
I would be most grateful
Thanks in advance
Tony



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