I am trying to figure out how to get all the parameters from a form that is dynamically built based on data retrieved from the server. I cannot update perl (5.8) due to vendor limitations.
The web page has a simple set of data
that is read from a csv file and my script creates a webpage form that asks the professor to check which books they want to keep. The data is sent via a post method to a perl script that grabs the data, creates an email and sends it via blat. Pretty simple until I realized the following.
The problem is some professors may have more than one book (maybe 50) on reserve. I looked at the Data:Dumper module and realized I could just increment the value/name for each row of data and check to see if it is undefined. Is this a decent way? I don't have access to an sql database to make this easier since it is used by the vendor and creating more tables could break something.
Not a perl expert, but seeking the wisdom here and hope to steadily improve.
Thanks in advance
<input type="hidden" value="Doe, Jane" name="Professor">
<input type="hidden" value="0116411160645 " name="IDNum">
<input type="hidden" value="Perl for dummies" name="Title">
<input type="hidden" value="COIS 101 name="Course">
<input type="hidden" value="13" name="Charges">
<input type="hidden" value="09-12-2013" name="LastUsed">
<input type="hidden" value="11-27-2012 " name="Placed">
<tr>
<td><input type="checkbox" value="KEEP THIS ITEM" name="Status"></td>
<td>0116411164951 </td>
<td>PF 3112 .W5 2013 </td>
<td>Perl for dummies </td>
<td>COIS101 </td>
<td>13 </td>
<td>09-12-2013</td>
<td>11-27-2012 </td>
</tr>
<input type="hidden" value="KEEP THIS ITEM"" name="Keep1">
<input type="hidden" value="Smith, Josh" name="Professor1">
<input type="hidden" value="0116411162016 " name="IDNum1">
<input type="hidden" value="Modern Perl" name="Title1">
<input type="hidden" value="COIS102" name="Course1">
<input type="hidden" value="999" name="Charges1">
<input type="hidden" value="09-12-2016" name="LastUsed1">
<input type="hidden" value="11-27-2016 " name="Placed1">
<tr>
<td><input type="checkbox" value="KEEP THIS ITEM" name="Status"></td>
<td>0116411162016 </td>
<td>Modern Perl </td>
<td>COIS102</td>
<td>999 </td>
<td>09-12-2016</td>
<td>11-27-2016 </td>
</tr>
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.