in reply to cgi question

You should be using CGI for this, but see if this helps you (untested):

print "<table>\n"; my %names; { open my $name, 'gly_structures.txt' or die; while ( <$name> ) { my ( $ref_num, $glycan_name ) = split /\|/; die if defined $names{ $ref_num }; # die on duplicates $names{ $ref_num } = $glycan_name; } } open my $struct, 'N_structures.txt' or die; while ( <$struct> ) { my $number = ( /(\d+)/ )[ 0 ]; next unless defined $number; my $GU_web; open my $info_web, "${number}_info.txt" or die; while ( <$info_web> ) { if (/^(\d+\.\d+)\D/) { # probably wrong $GU_web = $1; last; } } close $info_web; die unless defined $GU_web; my $image = qq(<IMG SRC="images/$number.gif">); defined( my $structure_name = $names{ $number } ) or die; print "<tr><td>$GU_web</td><td>$image</td><td>$structure_name</td></ +tr>\n"; } print "</table>\n";

the lowliest monk

Replies are listed 'Best First'.
Re^2: cgi question
by Anonymous Monk on Jun 03, 2005 at 14:24 UTC
    thanks for your help the code appears to work, by the images are replaced by broken boxes?

      The reason for this could be any number of things. Look at the HTML source generated by the script, and make sure that the files listed as src attributes actually exist and are readable by the server; also make sure that the directory where these files live is accessible to the server.

      It is probably simplest to troubleshoot this particular problem with static HTML (e.g. write an HTML file whose content is one table with just one row on it). Once you get the static HTML to work, worry about generating it programmatically with a CGI script.

      the lowliest monk

      is this a width height problem?