it seems you've fixed your immediate problem, although i see you've left yourself open to more problems in the future. i have a few suggestions:

sub BuildMMList { ## enforce strict programming methods (see strict) ## if you can't do this for the whole script, do it in each ## subroutine until the whole script has been refactored ## while you're at it, use warnings, too (see warnings) use strict; use warnings; ## pass parameters to the subroutine -- global variables are trouble ## assign the passed parameters to variables local to the scope of t +he sub my( $list, $mm_file ) = @_; ## use the three parameter form of open (see perlfunc) ## localize your filehandles to avoid namespace pollution ## don't quote variables unneccessarially (see perlvar) ## don't use the '&' sigil when calling subs (see perlsub) ## make your error messages verbose open( local *FILE, '<', $mm_file ) or error_message( "$0: Can't open data file: $mm_file: $!"); ## use a while loop to process the file in memory ## this avoids temp variables, and avoids c-like for loops while( <*FILE> ) { ## use the 3-arg form of split to limit fields ## throw away other fields by assigning to 'undef' my( $opt, undef ) = split /``/, $_, 2; ## use quote operators, so quote characters don't need to be escap +ed print qq{<option value="$opt">$opt</option>\n}; } }

i haven't tested this code, so there may be a bug or two lurking. anywhere i have a parenthesised note, you should use perldoc to find more info, or supersearch perlmonks for more.

i'm sorry i can't offer you more help (like using taint mode to safely process cgi params), but i hope this will get you started, and you'll go looking for more as you need it.

~Particle *accelerates*


In reply to Re^2: Split a database by particle
in thread Split a database by lisaw

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.