a happy new year... but some of us have to work on the holiday ;)
Got a code here that I need to generate an array so it can be used further down in the script. Here is the code snip
########### START OF CODE #################################
my @membership = $cgi->param('membership');
my $ct = ($#membership + 1);
my $x = 1;
my $totalct = ($ct+1);
unless($ct) { $apex->error("ERROR MESSAGE HERE"); }
my $col_arrayref = $apex->get_column_names("site_subscriptions"); my @savedata = (); my($sfield,$svalue,$description,$newline);
while ($x < $totalct) {
for (my $i; $i<@{$col_arrayref}; $i++) { next if $col_arrayref->[$i] eq 'signupid'; $sfield = $x.$col_arrayref->[$i]; $svalue = $cgi->param("$sfield"); $description = $x."description"; chomp $svalue;
unless($sfield eq $description) { unless($svalue) { $apex->error("$sfield is a required field"); } }
push(@savedata,$svalue); } $x++; }
print $cgi->header(); for my $data (@savedata) { chomp $data; print qq~$data<br>~; } exit(); #################### END OF SNIP ######################## # THESE ARE THE RESULTS 10 15.00 0.00 1 10 Days for $15 30 25.00 14.99 2 30 Days for $25
What I am trying to do, is create the @savedata array so the $data is stored like this so, each row a single line:
10 15.00 0.00 1 10 Days for $15
30 25.00 14.99 2 30 Days for $25
What is the best way to accomplisht this ??
TIA -- Mike<mickalo>Blezien =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Thunder Rain Internet Publishing Providing Internet Solutions that work! http://www.thunder-rain.com =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>