#!/usr/bin/perl
#This script appends to a vindex.html and adds the pictures to the users hyml directory, called public_html


#Packages to use
use Cwd;


#first we have some constants
$bigjpg_dir = "vjpg";
$smalljpg_dir = "svjpg";
$start = cwd();

# see what highest number yet used is:
$pictnum=100;
for ($counter=100;$counter<999;$counter++){
  if (-e "$bigjpg_dir/v$counter.jpg") {
	$pictnum = $counter;
  }
}


#first copy the pictures into the public_html directory
`cp vjpg/v$pictnum.jpg ~/public_html/v$pictnum.jpg`;
`cp svjpg/sv$pictnum.jpg ~/public_html/sv$pictnum.jpg`;

printf("highest lightvector is sv%d.jpg\n",$pictnum);
`echo "\<a href=v$pictnum.jpg\>\<img src=sv$pictnum.jpg\>\</a\>$pictnum" >> ~/public_html/vindex.html`;

