Assuming that each "line" of your variable is separated by a \n, you can use
the split() function.

my @array = split /\n/,$variable;

-----Original Message-----
From: Faymon, Kurt [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 01, 2002 5:51 AM
To: [EMAIL PROTECTED]
Subject: Reading lines in variable



Simple for some (most), perplexing me:

have a variable, say $Record which contains many lines (actually codes),
like:

<p>
<h>
<link>
<ref>
So on....

How can I roll through the value of the variable, capturing each line and
pushing it onto an array?

Kind like reading entries in a cfg file (one on each line) and putting them
in array?

thanks

kf


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to