Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-19 14:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found