I think I'd start with your question in HTML before worrying about how to get the perl code to do what you want. What do you want the page to look like? There are many ways to do what you're asking, so a bit more specific would be useful. Do you want the user to click on a link to go to an editable version of the page (href anchor), or do you want this page to be editable directly (rather than putting it in a td element, put the whole table in a form, and put your input element inside the td element, with a default value of the current value)?

Then I'd go on to cleanup. ;-) You don't need the qw(:standard) for your use CGI line if you are using the object-oriented version of CGI. Or, if you're using the procedural version, don't use the object version. It's just a bit confusing.

I'd then suggest going with some sort of templating solution to get rid of all that HTML embeded in your perl code. Even if you're worried about speed, it can often be faster to load a template than to have it compiled in. But, premature optimisations aside, it's also easier to read. Both the code and the template.

Then I would suggest the whole thing could use a significant paradigm shift by looking into CGI::Application. The flexibility you'll get going that way may just amaze you. It did for me.


In reply to Re: Editing Posted Data by Tanktalus
in thread Editing Posted Data by ejx2

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.