Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3800252
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T13:51:50+00:00 2026-05-19T13:51:50+00:00

I want make an irssi script which will notice of new files on server,

  • 0

I want make an irssi script which will notice of new files on server, but firstly I need a script in Perl which will return the newest file on the server (apache 2.2.16 with directory listing) and after the next script runs if there is no newer file then previous returns null or if there is a new file on the server return the link to that file. Thanks for any help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T13:51:51+00:00Added an answer on May 19, 2026 at 1:51 pm
    • Remember the script’s start time in a variable $start_time

      You will need to store “last run time” in some persistent way (cache, file, persistent session data, database/DBM file) later on.

    • Have the script generate the list of files you want (using glob() if it’s just files in a given directory, or File::Find if it’s recursive in a directory structure

    • For each file, find its creation or modification (whichever one you want) timestamp via stat call

    • Find the newest file using stat data. If you used glob to list files, do it by scanning the list; if File::Find, just do it as part of callback memorizing the “latest seen so far” file

    • Retrieve “last run time” persistent data

    • If the last file found is later than “last run time” , return link to that file. if not, return null

    • Save the start time ($start_time) of the script as a new value of “last run time” to wherever you chose to tore it.


    UPDATE

    If the list of files is NOT local (e.g. on a web server), you need to replace the glob step to list the files (and stat for timestamps) with scraping of the appropriate HTML page containing directory listing (using for example WWW::Mechanize to retrieve the page and HTML::Twig or HTML::Parser to parse the HTML and retrieve the filenames and timestamps. There are also modules specifically for reading contents of HTML tables and I wouldn’t be surprised if CPAN has a module to parse specifically Apaches file listing HTML.


    UPDATE2

    Looks like my hunch was right and there’s a possible module to parse the HTML output from mod_autoindex: File::Listing::apache (part of libwww-perl distribution)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want make a bash script which returns the position of an element from
I want to make some graphical dialogs for my script but don't know how.
I want make a SharedInterrupt class(B) which will serve in series many objects in
I want make a generic hibernate API which will create mapping class from hbm.xml
I am new to android ,I want make an app which needs a progress
i want make script evry 15min connect to 4 address and get new link
I want make binding effect in one place so I need to text which
I want make sql query which will insert values from one table to another
I am new android app developer i want make app for tablets and phone
I want to make a class serializable but i dont want make serializable some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.