Jon,

This is one way of doing it:

  use CGI;
  use CGI::Carp qw(fatalsToBrowser);

  $query=new CGI;

  print $query->header();
  print $query->start_html( -title=>'tt' );
  print $query->startform(  -method=>'POST', -name  =>'tt');

  local( *LOGFILE );

  $j = 0;
  open( LOGFILE, "logfile.txt" ) or die "Can't open logfile.txt: $!\n";
  while ( <LOGFILE> ) {
    chop;
    $LINKS{ $j++ } = $_ if( length( $_ ));
  }
  close( LOGFILE );

  print "<html>
         <body>
         <font color=red><center><b><font size=+1>Secondary navigation page</b><br>
         <table border=\"0\" cellspacing=\"2\" cellpadding=\"0\">
        ";

  print "<tr bgcolor=\"yellow\">\n";
  foreach $heading ( qw( Location ) ) {
    print "<th>$heading</th>\n";
  }
  print "</tr><br>\n";

  foreach $link (sort keys %LINKS)
  {

    print "<tr>
           <th bgcolor=\"cyan\"
           <td><a href=$LINKS{ $link }>$LINKS{ $link }</a></td>
           </tr>
        ";
  }
  print "</table>";
  print "</body>";
  print "</html>";

  print $query->end_form();

You need to study up on you basic's!!

Jerry

Jon Grant wrote:
> 
> Hi all,
> 
> I am a perl beginner and find myself somewhat stuck, please help!!
> 
> I am trying to write a program that will access a log file that has a list
> of resource addresses. The program will then create an html page that
> returns the last address from the log file as a link in an html page. I
> attach the logfile and application as text files. I would be very grateful
> if someone could have a look through my work and suggest where it is going
> wrong or suggest some alternatives.
> 
> Any help will be very gratefully appreciated!
> 
> Cheers,
> 
> Jon.
> 
>   
>------------------------------------------------------------------------------------------------------------------------------------------------------
>                        Name: firstattempt.txt
>    firstattempt.txt    Type: Plain Text (text/plain)
>                    Encoding: 7bit
> 
>                   Name: logfile.txt
>    logfile.txt    Type: Plain Text (text/plain)
>               Encoding: 7bit
> 
>   
>------------------------------------------------------------------------------------------------------------------------------------------------------
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

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

Reply via email to