Pls ellobarate ur question a little bit more.
I am agree with parshak. We cant understand wat actually u wana do.
Main Topics
Browse All TopicsI have made an JS array with "#" as the delimiter. The array may have from 1 to 5 elements--it will vary each time
I want to write it (along with other variables) into a file using perl so I can call up the data into a form as I need it later.
-How do I seperate each element into it's own scalar in the flat file?
-- Is there anything wrong with that approach?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Sorry-
What I'm doing is collecting data on a <form>. Most of the variables are single <text> inputs. Some are <textarea>s that create arrays (with the "#" delimiter between elements).
I want to write all the variables from each "submit" to make a tab delimited "record" in a flat file.
I want to parse the arrays into individual values that are treated just like the values from the <text> inputs in perl.
Is that any better?
to write a Perl file reading fromflat text file you have to do the following:-
1. your flat text file will look like:
Jone#25#Single
Mark#22#Single
Eric#29#Married
2. in your Perl program you shuld do this:
- Open the file:
open ( FIL , "flatfile.txt");
@lines = <FIL>;
close (FIL);
- to separate variables do this:
foreach $line ( @lines )
{
($name, $age, $marital ) = split( /#/, $line);
.
.
proccess the variables
.
.
}
Thats all.
Khamees
Thanks-
I think I've got the idea of "split"ing the array, but I think I have an additional problem.
I have both single variables AND arraies from the same form. In the snippet below "totalComments" several elements, the other two variables are single:
print TXTFILE $Q::docnum . "\t" .$Q::totalComments. "\t" .$Q::purpose."\n";
Don't I need to "break-down" the array somewhere first and then include the newly created variable in the 'print' statement.
If so, how do I get there.
Thanks
Business Accounts
Answer for Membership
by: prakashkPosted on 2001-05-23 at 12:20:38ID: 6113254
> I have made an JS array with "#" as the delimiter
How do you make an array with a delimiter?
Is the JS code writing this info to the file? And you want perl to parse it?
> -How do I seperate each element into it's own scalar in the flat file?
"Scalar in the flat file"? Do you mean that you want each element on a separate line?
> -- Is there anything wrong with that approach?
Unfortunately your question doesn't show any light on what you want to do.