#!/usr/bin/perl -w

use Tie::File;
use CGI;
use Fcntl 'O_RDONLY';
require "info.pl";

$current = "fulltext.txt";
$query = new CGI;
$lineNum = $query->param("line");
$book = $query->param("book");
print "status:200 OK\ncontent-type: text/html\n\n";

tie @array,'Tie::File', $current, mode => 'O_RDONLY' or die "Unable to tie file in showtext\n";
($a,$b) = split /\d/, $array[$lineNum];

$view = yes;

for $j (-5..5){
	if($j == 0){
		print "<b><br><body> $array[$lineNum + $j]</body></br></b>\n"; 
	}
	else{
		print "<br><body> $array[$lineNum + $j]</body></br>\n";
	} 
}
print "<br><a href=\"bookVerse.cgi?book=$book&line=$lineNum&view=$view\">To view the entire book of <b>$books{$book}</b> please click here </a></br>";
