
sub korrutustabel{
    print "****************************************************************************\n";
    print "************************Veebimeister 2002@**********************************\n";
    print "****************************************************************************\n";
    print "*****Programm on m6eldud korrutustabelite automaatseks genereerimiseks******\n";
    print "****************************************************************************\n";
    print "\n";    
    print "\n";    	
    print "\n";    
    print "Sisesta ridade arv tabelis: ";
    $ridu=<STDIN>;
    print "Sisesta veergude arv tabelis: ";
    $veerge=<STDIN>;
    $korrutis=$ridu*$veerge;
    
    open VALJA, ">korrutustabel.html";
        print VALJA "<html><head><title>KORRATABEL 1-$korrutis</title></head><body> <h2>KORRUTUSTABEL</h2><table border=1>\n" ;              
	for($i=1;$i<$ridu+1;$i++){               
           print VALJA " <tr>\n";       
         	
         	for($j=1; $j<$veerge+1; $j++){
         		$tulemus=$j*$i;
         		
			print VALJA "<td>$tulemus </td>\n";       
         		}  
           
        	 print VALJA " </tr>\n";       
      	  }
      
             
        print VALJA "    </table>\n";
        print VALJA "  </body>\n" ;
        print VALJA "</html>\n" ;
    close VALJA;
}



korrutustabel;