Print date last file in folder was updated

Discussion in 'HTML & Website Design' started by AccidentReport, Mar 31, 2008.

  1. #1
    Hi.

    I have moved a website from one server to another and updated it to run in PERL as the new host didn't have ASP enabled by default and I couldn't be bothered to get my domain moved to one that does. Anyway, I used to have a page which checks the folder which contained all the pages in this particular site and displayed the most recently modified date of the files.

    The code is:
    
    <%@ Language=VBScript %>
    
    <%
    	dim fs,fo,x
    	dim MostRecentDate
    	set fs=Server.CreateObject("Scripting.FileSystemObject")
    	set fo=fs.GetFolder("D:\webroot\website\")
    
    	for each x in fo.files
    		if x.DateLastModified > MostRecentDate then
    			MostRecentDate = x.DateLastModified
    		end if
    	next
    
    	set fo=nothing
    	set fs=nothing
    
    Response.Write "<p class='footer'>Last Updated by Me on: " & MostRecentDate & "</p>"
    %>
    
    Code (markup):
    Now, can something similar be done so that my site running in PERL will do the same thing? I have seen code that can check a specific file but haven't been able to work out how to check a folder.

    Any help much apreciated!
     
    AccidentReport, Mar 31, 2008 IP