SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jan 2000
    0 Post(s)
    0 Thread(s)
    Hi all,

    Recently I discovered that I need to write a PERL script which automatically refreshes my page (so the cache is not used). I know how to do this in sh, bash:

    echo Content-type: text/html
    /bin/cat /home/httpd/html/index2.html
    but the problem is that I am using NT and IIS and I cannot run such shell scripts. BAT files are also not allowed, so I cannot make the script using a BAT file, otherwise it would be easy.
    In fact "refresh" is not the exact word as you see from the shell script. I need to force the browser and the server not to use any cache.
    So here comes the question:
    How looks the PERL script for NT which does the same job as the shell script? Something like the lines below maybe?

    print "Content-type: text/html \n\n");
    open (FH,"filename.xx");
    print @fileData; close (FH);

    I know that in fact I am asking you to write me a script... but obviously I couldn't manage with this task by myself...

    I have included in my page the pragma no-cache in the meta tag... but it seems that it doesn't work... I have set up my page to expire 10 years ago... or to expire tight away when it is loaded... but This doesn't work on my computer. Here is the line I am using, tell me if there are mistakes:
    <META HTTP-EQUIV="Expires" CONTENT="0">

    Many thanks for your help,
    with best regards,
    Venelin Saltirov.

  2. #2
    Destiny Manager Plebius's Avatar
    Join Date
    Nov 1999
    0 Post(s)
    0 Thread(s)

    print "Content-Type: text/html\n";
    print "Pragma: no-cache\n\n";

    open(FILE, "$filename") | | print "Cant open file $!";
    while(<FILE> )
    print $_;


Posting Permissions

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