User Tag List

  1. Curryking's Avatar
    Hey everyone,

    I need a little help with a perl script (to read the content of a folder and put it into a *html file).

    print "Content-Type: text/html\n\n";
    $file = 'index.html';
    open(INDEX ,">$file") || die "Error $!";
    print INDEX "<html><head><title>Folder Content</title></head><body>\n";
    print INDEX "<h1>Headline</h1>\n";
    print INDEX "Hello World"
    foreach( glob( "*.*" ) )
    	print INDEX "<a href=\"$_\">$_</a><br/>\n";
    print INDEX "</body></html>\n";
    close INDEX;
    it does the trick, my problem, I want to delete these two lines of the output.

    <a href="index.html">index.html</a><br/>
    <a href=""></a><br/>
    Since I have the index.html and files in that folder, they are listet on the output to. I want to delete these 2 lines from the file... ( I know I could delete index.html before I call the script and call the script from outside the folder, but I want to run it that way and keep all files in one place.)

    Since this is the only time I use perl I do not want to read hundreds of tutorials (yes I already read a couple and googled), but I did not find the answer...

    Any help is appreciated!

    2012-03-17 04:25 PM
  2. Tom_Cruise's Avatar
    I also not find the correct solution about this problem...!
    2013-07-16 11:20 AM