Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Perl Beginners > Building/defini...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 5 Topic 10977 of 11060
Post > Topic >>

Building/defining variables from an value in string

by rmalghan@[EMAIL PROTECTED] (Ravi Malghan) Apr 22, 2008 at 02:08 PM

Hi: I have a string with a number of variable name, type and value pairs. I
want to split the field and build my variables. Below is an example

$string = "field1,int,10#field2,string,abc";
@[EMAIL PROTECTED]
 = split(/#/,$string);

I want to get two variables from the string, equivalent to the below
statements
$field1=10;
$field2="abc";

TIA.
Ravi



     
____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now. 
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ




 5 Posts in Topic:
Building/defining variables from an value in string
rmalghan@[EMAIL PROTECTED  2008-04-22 14:08:33 
Re: Building/defining variables from an value in string
jialinli1981@[EMAIL PROTE  2008-04-22 16:52:56 
Re: Building/defining variables from an value in string
myklass@[EMAIL PROTECTED]  2008-04-23 07:38:46 
Re: Building/defining variables from an value in string
noreply@[EMAIL PROTECTED]  2008-04-23 09:19:48 
Re: Building/defining variables from an value in string
Uri Guttman <uri@[EMAI  2008-04-23 08:46:21 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon May 12 21:47:38 CDT 2008.