Your code that assign field values to individule vars is very hard on the eyes and could be difficult to debug if you get one of those index wrong. This is compounded by the list being out of order (1 before 0) and the subroutine call hidden in the batch.
If you would keep this code tab it out so all the "=" and "$line_pair[]" are aligned. Either do the sub call right after the variable assignment and put some blank lines around it or just do after the whole transfer block.
On the other hand if you don't need to do the transfer at all, all the better. If all that you do is a straight display of the vars in the same order they are in the file then you don't need to transfer them.
If you need to manipulate a few of them them then create named indexes like (put near the top of your file)
and then call the sub this way# indexes to $line_pair $i_data = 5; #add more here if needed.
although this line is more complex there is only one of them, not 15. Also, without the transfer( it may still be needed if you are get the vars off an HTML form) the output line could go from:$line_pair[$i_data] = &stripBadHtml($line_pair[$i_data]);
toprint DATAFILEOUT "$time=$company_name=$email=$member1=$member +1phone=$data=$expiretime=$pictureurl=$password=$website=$member2=$mem +ber2phone=$address=$citystatezip=$fax=$catlisting\n"
In general code should not be hard to look at or look like it was hard to type in. Someone will have to look back at the code again sometimes and it is good practice to make code clear for the next programmer to look at it.print DATAFILEOUT join("=",@list_pair),"\n";
Remeber that next programmer may be you. Disclaimer
In reply to Re: Re: Flat Database: Outdated Info Removal
by admiraln
in thread Flat Database: Outdated Info Removal
by lisaw
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |