in reply to Re: Re: MSIE Favorite Start Page
in thread MSIE Favorite Start Page

I said I was ambivalent about CGI due to the nature of the script, and I know why after trying to rewrite it-- there's no lovely solution when loops are involved. I've banged my head up against it because I apparently enjoy the pain. So here's how I solved it with sub refs. (I left the HTML in 3.2 because I got lazy after all this).
use CGI qw(:standard -nodebug); ... same code through open () ... my $table_cell = sub { print "table_cell called\n"; (@linkName) ? return td( {-align => "left"}, a( {-href => pop( @linkURL ) }, pop( @linkName ) ) ) : return td(); }; my $table_rows = sub { print "table_rows called\n"; my $rows; foreach (@linkName) { $rows .= Tr( &$table_cell, &$table_cell ); } return $rows; }; print FILE ( start_html( -title => "Favorite Links", -bgcolor => "#000000", -link => "$lcolor", -alink => "$lcolor", -vlink => "$lcolor"), table( { -align => "center" }, &$table_rows ), end_html() ) or die "write error: $!\n"; ... and close ...

For the record (on Win95), your original code died on a filename with the (r) mark in it. And this was after I had commented out the System Error line (line 12) because it kept tripping there-- would you explain what that line does for us less advanced types? Once those two issues were sidestepped, it worked, rendering the very handy page.