am trying to output the first 20 lines of a .txt document with the
following code.  This is working correcting, which brings me to the next
issue that I cannot solve. As you will notice, I have a counter and would
like to include the counter in my html output

For example:
1. Title Icon
2. Title Icon
3. Title Icon
4. Title Icon

Etc....


Thank you in advance
Lance

open (WHATSNEWFILE, "< $whats_new_index_txt_filename")     || die "can't
open $file: $!";

        while (<WHATSNEWFILE>) {
        chomp;
        $file_line = $_;
        $file_line =~ s/[\t\n\e\f\r]//g;
        if ($file_line eq "") {
                last; #break
        }
        if ($line_count < 20) {
#---------------------------------------------------------Counter
        $line_count++;
#--------------------------------------------------------Increase counter
        print "-----> Count: $line_count\n";
        @line_array = split("::", $file_line);
        # Assemble the table that we are going to insert into the template
                if ($bgcolor_flag == 0) {
                        $bgcolor_flag = 1;
                        print "-----> bgcolor_flag 1: $bgcolor_flag\n";
                        $whats_new_index_text = $whats_new_index_text . 
$tr_bgcolor_one .
"\n";
                } else {
                        $bgcolor_flag = 0;
                        print "-----> bgcolor_flag 0: $bgcolor_flag\n";
                        $whats_new_index_text = $whats_new_index_text . 
$tr_bgcolor_two .
"\n";
                }
                $whats_new_index_text = $whats_new_index_text . "    " .
$td_label_value_root . $font_label_string_root;
                $whats_new_index_text = $whats_new_index_text . "<a href=\"" .
"../" . $result_path . $line_array[0];
                $whats_new_index_text = $whats_new_index_text . $line_count .
$alert_index_jsp_filename . "\">" . $line_array[1];#Trying to include the
counter value
                $whats_new_index_text = $whats_new_index_text .
"<\/a><\/font><\/td>\n";
    }
close(WHATSNEWFILE)                || die "can't close $file: $!";





-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to