#!/usr/bin/env perl

die "list-it: Please enter a valid directory as an argument.\n" if @ARGV != 1;
chdir($ARGV[0]);
$list = `ls`;
if ($list =~ /\slist\-it\s/) {
	open INDEX, ">index.html";
	print INDEX "<html>\n<head>\n<title>Directory 
listing</title>\n</head>\n<body>\n<ul>\n";
	@list = split /\s/, $list;
	foreach (@list) {
		print INDEX "<li>\n";
		print INDEX "<a href=\"$_\">$_\n</a>";
		print INDEX "</li>\n";
	}
      
	print INDEX "</ul>\n<br /><br /><br /><i><u><a 
href=\"http://stoerimpuls.net/\">stoerimpuls [dot] net
</a></i></u></body>\n</html>"; 
}

