Hello,
I trying to change a section of my code that opens a flat db with only one entry per line and allow it to open a flat db with multiple entries. The flat file that I'm working with is delineated with ``..anyone have any suggestions?
sub BuildMMList {
local ( $style ) = @_;
local ( $ret, $idx );
local ( *LIST );
local ( $line, @data, $key, %user, @ch );
$ret = '';
$idx = 0;
open( LIST, "<$MM_FILE" ) || &Error( "internal", "Missing page lis
+t" );
while ( $line = <LIST> ) {
# see if it's a page.
next if ( $line =~ /^#/ );
next if ( $line =~ /^\s+$/ );
$idx++;
# remove white space.
$line =~ s/^\s*//;
$line =~ s/\s*$//;
# display the table row
if ( $style eq 'delete' ) {
# !EMBEDDED HTML!
$ret .= <<EOF;
<TR>
<TD>
<INPUT NAME="page$idx" TYPE="hidden" VALUE="$line">
<INPUT NAME="action$idx" TYPE="checkbox" VALUE="delete">
<CODE>$line<\/CODE>
</TD>
</TR>
EOF
} else {
# !EMBEDDED HTML!
$ret .= <<EOF;
<OPTION>$line
EOF
}
}
close( LIST );
$_ = $ret;
}
Data File Example:
default1``default2``default3
thanks...still kinda new to this :(
edited: Wed Oct 23 21:17:35 2002
by jeffa - remember kids, always escape those embedded code tags ;)
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.