But your text fields all share the same name, 'pic' ... maybe what you want is a radiobutton group:
  <form>
  Foo <input value="foo" type="radio" name="pic" /><br />
  Bar <input value="bar" type="radio" name="pic" /><br />
  Baz <input value="baz" type="radio" name="pic" />
  </form>
Otherwise, your input fields should not share the same name.

There are a couple of ways to make radio buttons in Perl without to much fuss ... the first is by brute force, much like you did in your question. However, since the "stuff" from your tab delimited file is already stored in the array @fields, we can iterate across the loop and not have to worry about whether or not we are dealing with the second index or the eleventh index:

print "<form>\n"; for my $field (@fields) { print qq|<input value="$field" type="radio" name="pic" /><br />\n|; } print "</form>\n";
CGI.pm has a very handy method for generating radio boxes:
use CGI qw(:standard); print start_form, radio_group(-name => 'pic', -values => \@field), end_form, ;
I recommend that you visit and read Ovid's online Web Programming with Perl course. You will learn a lot of good stuff there. :)

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)

In reply to 2Re: Form File Field by jeffa
in thread Form File Field by n4mation

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.