Results 1 to 2 of 2

Your favorite Apple, iPhone, iPad, iOS, Jailbreak, and Cydia site.

Thread: Perl Script to build index.html

  1. #1
    My iPhone is a Part of Me Curryking's Avatar
    Join Date
    Feb 2011
    51.22N / 6.77E
    Thanked 2,701 Times in 449 Posts

    Default Perl Script to build index.html
    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!


  2. #2
    I also not find the correct solution about this problem...!

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts