Ok. First some preamble. I have a webpage that is loaded with a users saved CSV file containing a database of items, each row is one item with 15 fields of designated information about that item.
On this page the file is read and using a foreach loop to print out a small form for each item. Each form field is prefilled using the $title, $price, $shipping ect variables from the csv file.

Form for item one title, price, size, shipping
form for item two title, price, size, shipping
form for item three title, price, size, shipping
form for item four title, price, size, shipping
and so on until all lines are read.

I wish to have it so when a user edits the title for a item and pushes a save button it re-writes the CSV file with any new changes made. I was trying something like the following but I know its all wrong. When called it returns like as if it worked but yet nothing actually happens


my ($title, $reserve, $inc, $desc, $image1, $image2, $image3, $image4) $form{'RETURNPOLICY'} =~ s/\</\&lt\;/g; $form{'RETURNPOLICY'} =~ s/\>/\&gt\;/g; $form{'item'} = $rdata5; foreach $invrecord (@allrecords){ open (NEWSHT, ">>$config{'basepath'}$config{'inventory'}/spreadshe +ets/$form{'item'}.dat") or die "Could not edit your inventory spreads +heet file :$!\n"; print NEWSHT "$form{'TTITLE'}$fielddelimiter$form{'RESERVE +'}$fielddelimiter$form{'INC'}$fielddelimiter$form{'DESC'}$fielddelimi +ter$form{'IMAGE1'}$fielddelimiter$form{'IMAGE2'}$fielddelimiter$form{ +'IMAGE3'}$fielddelimiter$form{'IMAGE4'}"; close NEWSHT; }

In reply to Passing Multi Form Page as array to write CSV file by Baffled

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.