help with split function - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


help with split function

edw888edw888 Posts: 1Member
Is it possible to use a form to decide how many fields there are in a database. The reason is that i have several databases with different field counts and it would be great not to have to go into the script and change split line according to what file i use.

Example: I know there are 3 fields in database1.txt and those fields are seperated by the pipe delimiter. Can I type "first,second,third" in a form named fields and have it inserted in the split function.

($$FORM{'fields'}) = split(/|/,$list);
print "First name: $first
Last name: $second


I Know there's got to be a way somehow but i can't find it. I tried all kinds of clever, ugly and unorthodox methods to do this to no avail. Came close with this. But it only shows the first field only. Any help would be appreciated. Thanks.

@kkk = "$FORM{'fields'}";
foreach $i (@kkk) {
($$i) = split(/|/,$list);
print "First name: $first
Last name: $second


Sign In or Register to comment.